ID:1916605
 
(See the best response by Colesprite.)
I was wondering is there a way to check a number that has 3.12e+06 or w/e it is to see what e+0x number it is? so like if i checked if its equal to e+07 i could say its a 10mil via code? because i have no idea how to code it to check if its on e+06 and onward except by literally putting in if(number==100000000000000000) etc

Try breaking up huge numbers into smaller numbers.

var/billions = 0
var/int = 0

proc/bigint(n)
while(n<1000000000)
billions++
n-=1000000000


A bit of a crude example, but it gets the point across. This is most effective when you're able to do it recursively.
I would bring up the question of why you're using numbers that big in the first place, as I can almost guarantee it isn't needed.

But to answer the question, no. The scientific notation is added on when it is displayed, but the number remains the same. 3.12e+06 is the same thing as 3.12 x 106. You just need to move the decimal 6 places to the right. With this knowledge, you should be able to do whatever you want with simple math in DM.

Though, I still stand by my first point - I don't believe there is much of a reason at all to have numbers that big outside of very niche cases.
In response to Albro1
Best response
Albro1 wrote:
I would bring up the question of why you're using numbers that big in the first place, as I can almost guarantee it isn't needed.

But to answer the question, no. The scientific notation is added on when it is displayed, but the number remains the same. 3.12e+06 is the same thing as 3.12 x 106. You just need to move the decimal 6 places to the right. With this knowledge, you should be able to do whatever you want with simple math in DM.

Though, I still stand by my first point - I don't believe there is much of a reason at all to have numbers that big outside of very niche cases.

Probably a dragon ball z game

In response to Colesprite
Colesprite wrote:
Albro1 wrote:
I would bring up the question of why you're using numbers that big in the first place, as I can almost guarantee it isn't needed.

But to answer the question, no. The scientific notation is added on when it is displayed, but the number remains the same. 3.12e+06 is the same thing as 3.12 x 106. You just need to move the decimal 6 places to the right. With this knowledge, you should be able to do whatever you want with simple math in DM.

Though, I still stand by my first point - I don't believe there is much of a reason at all to have numbers that big outside of very niche cases.

Probably a dragon ball z game

This is what I was going to say! :)
In response to Colesprite
Colesprite wrote:
Probably a dragon ball z game

Someone smells what the Rock is cookin'.


round(log(10, n))
Word of advice, don't work with huge numbers in BYOND. Arithmetic gets funky if you do it the standard way. Sometimes it won't subtract. Sometimes it won't add. Sometimes it won't do anything. Sometimes it does more than you intend.
If you need to use big numbers, you need to use a library or something similar that will help. But big numbers are really bad for balance. Keep your stats low and the game will be so much easier to manage.