I’m porting my prime number generation code to Typst. I’ve already written this in quite a few other languages so the logic should be fairly solid.
But I get a “loop seems to be infinite” error, and I don’t know whether I’ve made an error in the porting or I’m just running into an arbitrary limit.
I can’t find anything about this error in a forum search, and perhaps I’m pushing the Typst language into things it shouldn’t be used for, but this same algorithm runs happily in Lua and PostScript, so I don’t think I’m asking for anything terribly demanding.
I’m attaching a test case which may have other errors in it, I make no promise that “loop seems to be infinite” is the only thing wrong with it. You can see the same algorithm in lots of other languages at codeberg .
My actual question: is there a way to suppress this error and run the code anyway, accepting responsibility for a potential infinite loop?
genprimes.typ (874 Bytes)