Max value a number can hold?

Get help using Construct 2

Post » Wed Jun 03, 2015 12:40 pm

What is the maximum value that a generic number variable can hold?
B
3
Posts: 8
Reputation: 191

Post » Wed Jun 03, 2015 2:56 pm

Probably something around 1.7976931348623157e+308, the maximum "numeric" value of a javascript number variable.
B
69
S
28
G
24
Posts: 977
Reputation: 18,739

Post » Wed Jun 03, 2015 2:57 pm

you could just run a test.. but I would imagine it's an unsigned integer..

approx 4 billion

https://msdn.microsoft.com/en-us/library/296az74e.aspx
B
97
S
32
G
15
Posts: 1,188
Reputation: 16,158

Post » Wed Jun 03, 2015 3:00 pm

yeah @Magistross is probably more accurate.. I'm still thinking in the 90's
B
97
S
32
G
15
Posts: 1,188
Reputation: 16,158

Post » Wed Jun 03, 2015 4:45 pm

Well if we're talking strictly integers, javascript as a constant you can use. Number.MAX_SAFE_INTEGER, which is equal to 2^53 - 1, or 9007199254740991, which is the highest integer javascript can represent "exactly". However, bitshifting is limited to 32bits, so to be really safe, you should stay in the 2^32 - 1 range, which is quite enough to be frank !
B
69
S
28
G
24
Posts: 977
Reputation: 18,739


Return to How do I....?

Who is online

Users browsing this forum: plinkie, rayolf and 7 guests