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

James Foster Smalltalk at JGFoster.net
Sun Dec 21 03:18:55 UTC 2008


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




More information about the Squeak-dev mailing list