D
Dr J R Stockton
In comp.lang.javascript message <[email protected]>,
The previous FAQ maintainer wasted everybody's time in foolish argument,
instead of incorporating useful suggestions into a published FAQ. Stop
heading in the same direction.
<URL:http://www.merlyn.demon.co.uk/js-misc0.htm#CDC> now shows
conversion from an expression (using covert eval) to a Number and then
(in two Forms) either to 4 bytes or 4 words shown in binary respectively
representing the value as an IEEE Single or to an IEEE Double. Those
displays are editable and can be converted both back to Number (shown by
default toString) and on to *exact* representations of the sign,
exponent, mantissa, and complete value as decimal strings. AFAIK, it's
OK for all finite values up to or almost up to the limit of the type;
but it could do with more testing.
In Doubles :-
0.01 +0.01000000000000000020816681711721685132943093776702880859375
0.06 +0.059999999999999997779553950749686919152736663818359375
0.06+0.01 +0.06999999999999999278355033993648248724639415740966796875
0.07 +0.070000000000000006661338147750939242541790008544921875
Ruler ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
The resolution of a Double (Number) is about 1 in 9e15.
Seeing that might help VK understand the situation.
It's a good idea to read the newsgroup c.l.j and its FAQ. See below.
Lines: 127
VK said the following on 3/20/2007 1:19 PM:
Are you really that anal?
...
The previous FAQ maintainer wasted everybody's time in foolish argument,
instead of incorporating useful suggestions into a published FAQ. Stop
heading in the same direction.
You really need a new hobby. BTW, where is that rounding function? :-X
<URL:http://www.merlyn.demon.co.uk/js-misc0.htm#CDC> now shows
conversion from an expression (using covert eval) to a Number and then
(in two Forms) either to 4 bytes or 4 words shown in binary respectively
representing the value as an IEEE Single or to an IEEE Double. Those
displays are editable and can be converted both back to Number (shown by
default toString) and on to *exact* representations of the sign,
exponent, mantissa, and complete value as decimal strings. AFAIK, it's
OK for all finite values up to or almost up to the limit of the type;
but it could do with more testing.
In Doubles :-
0.01 +0.01000000000000000020816681711721685132943093776702880859375
0.06 +0.059999999999999997779553950749686919152736663818359375
0.06+0.01 +0.06999999999999999278355033993648248724639415740966796875
0.07 +0.070000000000000006661338147750939242541790008544921875
Ruler ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
The resolution of a Double (Number) is about 1 in 9e15.
Seeing that might help VK understand the situation.
It's a good idea to read the newsgroup c.l.j and its FAQ. See below.