Subject: Re: Unexpected "double" behaviour
To: NetBSD help <netbsd-help@netbsd.org>
From: Matthew Fincham <matthewf@cat.co.za>
List: netbsd-help
Date: 09/26/2001 14:10:06
> bash$ bc -l
> ibase=2
> .0111001110110110010001011010000111001010110000001000001100010010
> .4519999999999999999765812330743131042254390195012092590332031250
>
>As you can see, the result is not 0.452... There is no exact binary
>representation for 0.452. As all floatingpoint values are stored as
>fraction and an exponent, (double)452 has no exact binary representation
>as well.


Thank you for your response. This seems remarkable - there are values that
connot be represented using floating point numbers, even though as decimal
numbers they are "simple" (non-recursive, and without any fractional part
e.g. 452). Are there any other such numbers?

Matthew Fincham