Float problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Float problem

Joseph Pelrine-7
It is just me thinking strangely again, or am I correct in assuming the
fact that my D6 image evaluates

        Float fmin > 0

and returns true, is not quite correct?

Cheers
Joseph

BTW: reports of my leaving Smalltalk have been greatly exaggerated!


Reply | Threaded
Open this post in threaded view
|

Re: Float problem

Bruno Brasesco
Joseph Pelrine escribió:
> It is just me thinking strangely again, or am I correct in assuming the
> fact that my D6 image evaluates
>
>     Float fmin > 0
>
> and returns true, is not quite correct?

Is it is correct
Float fmin = 2.2250738585072e-308

Remember:
(intBase raisedTo: intExp negated) = (1 / (intBase raisedTo: intExp))

Evaluate this in Dolphin:
(27 raisedTo: -3) = (1 / (27 raisedTo: 3))

A positive number raised to a negative number is always > 0. (1/xxxxxx)

Regards Bruno


Reply | Threaded
Open this post in threaded view
|

Re: Float problem

Schwab,Wilhelm K
In reply to this post by Joseph Pelrine-7
Joseph Pelrine wrote:
> It is just me thinking strangely again, or am I correct in assuming the
> fact that my D6 image evaluates
>
>     Float fmin > 0
>
> and returns true, is not quite correct?

It's 2^(-308) or so, which is a very(!!) small positive number, so the
test is correct.

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Float problem

Joseph Pelrine-7
Bill Schwab wrote:

> Joseph Pelrine wrote:
>
>> It is just me thinking strangely again, or am I correct in assuming
>> the fact that my D6 image evaluates
>>
>>     Float fmin > 0
>>
>> and returns true, is not quite correct?
>
>
> It's 2^(-308) or so, which is a very(!!) small positive number, so the
> test is correct.

Thanks, Bill, now I see where my logic error was. Must have been the
weather...

Cheers
Joseph