0

when i raised the power of matrix[[1, 2, 3], [4, 5, 6], [7, 8, 9]] to 1000,

occur code=EXC_I386_INVOP error.

Is it possible that this error is caused by a large Int?

유진필
  • 21
  • 3
  • 1
    The entries of the result are integers with approx 1200 decimal digits – so yes, the integer arithmetic does overflow. Compare https://stackoverflow.com/questions/31417588/integer-overflow-gives-exc-bad-instruction-in-swift. – Martin R May 05 '19 at 07:48
  • @MartinR It works!! Thank you for your helping!! – 유진필 May 05 '19 at 07:53
  • You could use a `BigInt` library like [this one](https://github.com/attaswift/BigInt). – ielyamani May 05 '19 at 09:35

0 Answers0