Smallest number

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

Smallest number

Fernando Rodríguez
Hi,

        Is there a way, via refelction, to know what's the smallest
representable positive number on a given implementation of St?

Thanks


Reply | Threaded
Open this post in threaded view
|

Re: Smallest number

Chris Uppal-3
Fernando,

> Is there a way, via refelction, to know what's the smallest
> representable positive number on a given implementation of St?

Do you need a portable solution, or will Float class>>fmin do ?

If not then I seem to remember that Didier Bessets' book has a routine to
discover the smallest representable Float, but I can't remember the details
offhand.  It was something like "divide by 2 until an Underflow exception gets
thrown", but that (at least for Dolphin) requires a certain amount of messing
to ensure that Dolphin's running in a mode where it asks the CPU to report
underflow "errors", it doesn't by default.

    -- chris


jas
Reply | Threaded
Open this post in threaded view
|

Re: Smallest number

jas
In reply to this post by Fernando Rodríguez
Fernando wrote:
> Hi,
>
> Is there a way, via refelction, to know what's the smallest
> representable positive number on a given implementation of St?
>
> Thanks

Sure - Zero.

For smallest strictlyPositive, I'd check in the neighborhood of
( whatever IEEE says fits 32 bits ) with exponent reduced by 4.

Just a swag, though.

Regards,

-cstb


Reply | Threaded
Open this post in threaded view
|

Re: Smallest number

Udo Schneider
In reply to this post by Chris Uppal-3
Chris Uppal wrote:
  > If not then I seem to remember that Didier Bessets' book has a
routine to
> discover the smallest representable Float, but I can't remember the details
> offhand.  It was something like "divide by 2 until an Underflow exception gets
You can get the libs here:
http://sourceforge.net/projects/dhbnumerics/

However I made the expirience that the books helps a lot to understand
the inner workings of it.

CU,

Udo


Reply | Threaded
Open this post in threaded view
|

Re: Smallest number

Fernando Rodríguez
In reply to this post by Chris Uppal-3
On Wed, 2 Mar 2005 17:55:55 -0000, "Chris Uppal"
<[hidden email]> wrote:

>Fernando,
>
>> Is there a way, via refelction, to know what's the smallest
>> representable positive number on a given implementation of St?
>
>Do you need a portable solution, or will Float class>>fmin do ?

No, that's more than enough, thanks. :-)