Javascript | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 18

Javascript

In a lesson they included this sentence as a note: "JavaScript numbers are always stored as double precision floating point numbers." So I don't really get it what they mean by "double precision floating point" Comments sections are confusing there 😞 It would be amazing if someone explains it😁 Thank you for spending your time! Lesson (section 2)👇 https://www.sololearn.com/learn/JavaScript/1129/

12th Jul 2019, 10:33 PM
KingDaniel2004
KingDaniel2004 - avatar
3 Answers
+ 4
That would mean it uses 8 bytes for integer and non-integer numbers. Other languages like C, Java etc. also have the less precise (4 byte) single precision floating point numbers which JS doesn't.
13th Jul 2019, 12:09 AM
Sonic
Sonic - avatar
+ 3
A double-precision floating point number is a floating point number with the size of 8 bytes. Basically floating point is a number that can store fractional value, like 1.37, 0.153, 82.17, and so on. So, basically, floating point is a real number, not just an integer, and the double precision is used to indicate it's size, which is 8 bytes You can refer to https://en.m.wikipedia.org/wiki/Floating-point_arithmetic https://en.m.wikipedia.org/wiki/Double-precision_floating-point_format
12th Jul 2019, 10:48 PM
Agent_I
Agent_I - avatar
- 3
rec
13th Jul 2019, 1:52 AM
weryn