Is this thing really infinity? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Is this thing really infinity?

How can a pc make an infinite calculation it's not possible? Why is it saying infinity? https://code.sololearn.com/WCHaBSa11LZ7/

8th Aug 2020, 1:26 PM
Ved Thaker
Ved Thaker - avatar
6 Answers
+ 4
> Lord Krishna v@msi but if the device is better does it make the real calculation Come again? The code i shared actually gets run as needed. There's no, "more powerful or modern device won't run, or not do the calculation". Any large number will simply return infinity.
8th Aug 2020, 4:48 PM
Lord Krishna
Lord Krishna - avatar
+ 3
Actually maxnumber is 2^1024. Try alert(Math.pow(2, 1024)) #returns infinity on my device or alert(Number.MAX_VALUE) Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE
8th Aug 2020, 2:58 PM
Lord Krishna
Lord Krishna - avatar
+ 2
Lord Krishna ok thnx
8th Aug 2020, 4:49 PM
Ved Thaker
Ved Thaker - avatar
+ 2
Because it is beyond the scope of the machine used...
10th Aug 2020, 9:34 AM
Sanjay Kamath
Sanjay Kamath - avatar
+ 1
If you crossed the limit it shows infinity. limit: 2^1024(int) or 1.7e+308 (float)
8th Aug 2020, 1:50 PM
v@msi😉
v@msi😉 - avatar
+ 1
Lord Krishna v@msi😏😏 but if the device is better does it make the real calculation
8th Aug 2020, 4:44 PM
Ved Thaker
Ved Thaker - avatar