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
78
S
32
G
27
Posts: 1,021
Reputation: 20,952

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
100
S
33
G
16
Posts: 1,204
Reputation: 16,875

Post » Wed Jun 03, 2015 3:00 pm

yeah @Magistross is probably more accurate.. I'm still thinking in the 90's
B
100
S
33
G
16
Posts: 1,204
Reputation: 16,875

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
78
S
32
G
27
Posts: 1,021
Reputation: 20,952


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 35 guests