I´m new at programming with Swift and wanted to make a program calculating prime numbers. I made it in a playground and first only as a playground program. Then I wanted to make it a function, so i can calculate prime numbers in a Intervall from 0 to a chosen number in another function. Only as a playground it all went well, but as a function it doesn't work anymore and brings the Error " EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)". Do you Guys have a idea how to fix this?enter image description here
Asked
Active
Viewed 17 times
0
-
it would be helpful if you can paste your Playground code here. – Jinhyung Park Sep 24 '20 at 07:49
-
1Different algorithm but same issue: The number exceeds the `Int(64)` range. – vadian Sep 24 '20 at 07:53