Comment on Detached Point ArithmeticComments−vgo961yThe author says that every real number x can be represented asx = m * 2^pwhere m is an integer(mantissa) and p is an integer (point position)Well this is clearly wrong, take x = 1/3 for example1/3 = m * 2^pm = 1 / (3 * 2^p), where m is an integer, doesn't hold true for any integer p.If the author had read first 2 pages ofhttps://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.h...they could have avoided the embarrassment.−SetTheorist1yAmusingly, even the numbers in the first example are counter-examples to the author's false claim: neither 0.1 nor 0.2 can be represented thusly.−cmrx641ybrilliant reference, thank you!
Comments
The author says that every real number x can be represented as
x = m * 2^p
where m is an integer(mantissa) and p is an integer (point position)
Well this is clearly wrong, take x = 1/3 for example
1/3 = m * 2^p
m = 1 / (3 * 2^p), where m is an integer, doesn't hold true for any integer p.
If the author had read first 2 pages of
https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.h...
they could have avoided the embarrassment.
Amusingly, even the numbers in the first example are counter-examples to the author's false claim: neither 0.1 nor 0.2 can be represented thusly.
brilliant reference, thank you!