On 11/17/2012 9:39 AM, Nick Keighley wrote:
> On Nov 15, 1:04 pm, hormelf...@gmail.com wrote:
>> On Tuesday, November 13, 2012 5:43:13 AM UTC-8, Ben Bacarisse wrote:
>>> Marcin Lukasik <mluka...@yazino.com> writes:
>
>>>> But does this mean that VALUE(2) stores 300.029999 or 300.03?
>>
>>> Neither! It is stored as the closest floating point number to 300.03. Exactly
>>> what that is is probably not important to you, but you can work it out if you
>>> really need to know.
>>
>> It's likely to have "5" as the last digit...
>
> why? I'm pretty sure this isn't so, but I'm interested in what made
> you think that.
Consider a decimal fraction whose rightmost non-zero
digit is *not* five. Multiply that fraction by a suitable
power of ten so the rightmost non-zero is now in the tenth's
place. The product is
[integer] + {1,2,3,4,6,7,8,9}/10
Your mission, should you choose to accept it, is to represent
all eight possible fractions in binary, that is, as quotients
of the form N/2^K for positive integer N and K. Good luck, Nick,
and if you or any of your team experience numerical frustration,
the Secretary will disavow all knowledge.
--
Eric Sosman
d