In python to get the smallest positive usable number for a float you can use:

numpy.finfo(float).tiny

Julia implement the function `eps`

, but I don’t see nothing similar to tiny.

Thanks.

In python to get the smallest positive usable number for a float you can use:

numpy.finfo(float).tiny

Julia implement the function `eps`

, but I don’t see nothing similar to tiny.

Thanks.

1 Like

What does usable mean? Do you mean `eps(0.0)`

?

I don’t know what’s means “mean”. But it’s not the same as `eps(0.0)`

.

python:

np.finfo(float).tiny

Out[1]: 2.2250738585072014e-308

julia:

julia> eps(0.0)

5.0e-324

I’m translating code from python and this `tiny`

function is use in a `max`

function as a minimum value for a variable.

Hmm, the numpy docs really do say that.

More precisely, this is the smallest magnitude normal floating point number, which is available in Julia via `realmin(Float64)`

.

4 Likes

It makes sense.

Thanks.

The positive normal Float64 value of least magnitude is

` realmin(Float64) == 2.2250738585072014e-308`

;

the least negative normal Float64 is `-realmin(Float64)`

.

These are smallest Float64 values that are *normal*ly represented.

They are not the smallest Float64 values that are usable. Those are

*subnormal* (values with less precision used for the significand).

The most pos subnormal Float64 is 2.2250738585072009e-308.

The least pos subnormal Float64 is 4.9406564584124654e-324.

There are corresponding negative values.