BigNum Library Ported to Roblox

Moved from #learning-resources:community-tutorials-resources to #bulletin-board to save space in community resources.

The original post linked to a (very) quick port of a BigNum module to Roblox, however there has since been a better alternative posted. Check out RoStrap for a BigNum library and other great libraries.

13 Likes

If you’re going to host the file on GitHub, you should rename the file to have a .lua extension at the end for syntax highlighting.

1 Like

How do the numbers created using this module differ in terms floating point accuracy? Are they somehow more accurate, or does the module make use of decimal cases to increase the numeric limit threshold for integers?

PS: Thank you for this module, and welcome to GitHub!

Is floating point accuracy an issue for integers? I hadn’t thought about checking if this module has the ability to work with decimals, but it turns out it doesn’t, sadly. I’ll edit the post to make that clear as a limitation.

As far as I’ve seen, the module can handle very large numbers precisely.

1 Like

This is a very interesting side-behavior, thank you for the heads up!

There are workarounds you could do to use decimals, however. For example, if you wanted to use BigNum for currency, then you would just need to remember that $1.00 is the same as BigNum.new(100). Then whenever you display it you can place a decimal before the last two digits.

This obviously isn’t proper decimal support, but at least it isn’t entirely limiting.

This topic was automatically closed after 1 minute. New replies are no longer allowed.