Should, maybe. Will print, No. Actually the code I posted won’t necessarily print the last .0Shalini Srivastav wrote:It should print
Jesper de Jong wrote:The precision of a float is approximately 6 or 7 decimal digits - it cannot hold 10 decimal digits, so it won't print 1234567890.0.
Shalini Srivastav wrote:
Jesper de Jong wrote:The precision of a float is approximately 6 or 7 decimal digits - it cannot hold 10 decimal digits, so it won't print 1234567890.0.
But below post shows, it can hold more than 10 decimal digits i.e. 340,000,000,000,000,000,000,000,000,000,000,000,000
https://coderanch.com/t/391176/java/java/Floating-point-numbers-range
Campbell Ritchie wrote:Some people say that 0 is not a digit, so 3400000000000000... is actually two digits.
The example given prints (I think) 1.2345694e+9. After the 6, the figures shown are inaccurate.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
fred rosenberger wrote:
And this:
0.0000001
is seven significant digits (ok...maybe six...i'm not sure if you count the zero in the 'ones' place).
John Jai wrote:A digit is significant if it resembles a value. So after the decimal point, all the digits listed are significant 0000001.
0.000001000 - here the 3 zeros followed by the 1 are insignificant.
God is a comedian playing for an audience that is afraid to laugh - Voltair. tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|