ID:132889
 
//-1 should equal 16777215 and will be 15
//+1 should equal 16777217 but will be 16
mob/verb/testmaxint()
var/number=16777216
world<<"[num2text(number-1,9)]"
world<<"[num2text(number+1,9)]"

This number (16777216) seems to be the largest that byond supports with precision accuracy. Would it be possible to get support for larger numbers?

The benefit of larger numbers would be in games that need them such as space games in which players can accumulate mass credits/money. The benefits seem to outweigh the disadvantages in respect to being able to deal (with precision) larger numbers.
Leur wrote:
> //-1 should equal 16777215 and will be 15
> //+1 should equal 16777217 but will be 16
> mob/verb/testmaxint()
> var/number=16777216
> world<<"[num2text(number-1,9)]"
> world<<"[num2text(number+1,9)]"
>

This number (16777216) seems to be the largest that byond supports with precision accuracy.

Correct. BYOND's number system uses 32-bit floating point which is limited to 24 bits of precision.

Would it be possible to get support for larger numbers?

Perhaps in the "maybe eventually" category. There are a few problems inherent with big number support, one of which is the need to rework a lot of our routines that deal with numbers. The biggest though is that a big number would basically need its own memory-referenced structure like a datum, which would mean 1) we'd have to use a reference count on it, and 2) the number of them that could be in use at any given time would have limits, albeit high ones.

As a workaround, though admittedly not a great one, you can store large numbers in text strings and come up with routines to do the math operations you need on those.

Lummox JR
In response to Lummox JR
Lummox JR wrote:
As a workaround, though admittedly not a great one, you can store large numbers in text strings and come up with routines to do the math operations you need on those.

Another workaround is not using such stupidly large numbers. If you want players to accumulate millions of spacebux because you like the idea of millions of spacebux, then you don't need precision down to $1, and should just deal with it in, say, thousands. IE:

mob
var/spacebux = 1
verb/how_rich_am_I()
usr << "You have $[spacebux]000 spacebux!"