[squeak-dev] FloatArray gives unexpected results with float numbers.

Nikolay Suslov nsuslovi at gmail.com
Sun Dec 21 09:29:46 UTC 2008


James,

Sorry for not clear problem statement,
Yes, the unexpected result is that the float number isn't the same, after
adding to FloatArray.

Thanks,
Nikolay

On Sun, Dec 21, 2008 at 4:18 AM, James Foster <Smalltalk at jgfoster.net>wrote:

> On Dec 20, 2008, at 5:54 PM, Nikolay Suslov wrote:
>
>  Hello,
>>
>> It is a bug.. or?
>>
>
> A misunderstanding.
>
>  FloatArray newFrom: {0.938611557944869}.
>> Expecting result is the entered float number, but evaluating gives - a
>> FloatArray(0.938611567020416).
>>
>
> Float has the following class comment: "My instances represent IEEE-754
> floating-point double-precision numbers."
> FloatArray has the following class comment: "FloatArrays store 32bit IEEE
> floating point numbers."
>
> I think what you are seeing is the conversion of 64-bit floating point to
> 32-bit floating point. Sorry for the initial confusion about your expected
> result.
>
> James
>
>  Nikolay
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20081221/d99c8ddb/attachment.htm


More information about the Squeak-dev mailing list