Talk:Almkvist-Giullera formula for pi: Difference between revisions
Talk:Almkvist-Giullera formula for pi (view source)
Revision as of 08:19, 2 September 2023
, 9 months ago→Divide by zero error in big.wren; shouldn't there be a little more robust error-handling in the big.wren Library?: Puzzled, as there's no error when I run it myself.
(→Divide by zero error in big.wren; shouldn't there be a little more robust error-handling in the big.wren Library?: Puzzled, as there's no error when I run it myself.) |
|||
Line 22:
Thanks,
Retired_Build_Engineer
:I'm puzzled by this error since, when I run the example (as posted) on my own machine, there's no error and the output is as expected.
:Are you perhaps trying to run a modified version?
:As far as error handling is concerned in Wren-big, a division by zero error is generally unrecoverable as there is no infinity support for big integers like there is with floating-point. So that's why I've chosen to abort the fiber in line 472. If you were writing an application where you couldn't tolerate the script ending prematurely, then you'd need to run the code in a separate fiber using Fiber.try() and thereby catch any error to give you the opportunity of handling it more gracefully. Note that Wren doesn't support exceptions as such. --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 08:19, 2 September 2023 (UTC)
|