# The smallest positive usable number

**URL:** <https://discourse.julialang.org/t/the-smallest-positive-usable-number/981>\
**Category:** General Usage\
**Created:** [December 15, 2016, 9:50pm UTC](https://discourse.julialang.org/t/the-smallest-positive-usable-number/981 "2016-12-15T21:50:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alvaro\_M](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@Alvaro\_M](https://discourse.julialang.org/u/Alvaro_M)\
**Post date:** [December 15, 2016, 9:50pm UTC](https://discourse.julialang.org/t/the-smallest-positive-usable-number/981/1 "2016-12-15T21:50:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![johnmyleswhite](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnmyleswhite/32/31_2.png) [@johnmyleswhite](https://discourse.julialang.org/u/johnmyleswhite)\
**Post date:** [December 15, 2016, 9:55pm UTC](https://discourse.julialang.org/t/the-smallest-positive-usable-number/981/2 "2016-12-15T21:55:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Alvaro\_M](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@Alvaro\_M](https://discourse.julialang.org/u/Alvaro_M)\
**Post date:** [December 15, 2016, 10:23pm UTC](https://discourse.julialang.org/t/the-smallest-positive-usable-number/981/3 "2016-12-15T22:23:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![simonbyrne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simonbyrne/32/19_2.png) [@simonbyrne](https://discourse.julialang.org/u/simonbyrne)\
**Post date:** [December 15, 2016, 10:50pm UTC](https://discourse.julialang.org/t/the-smallest-positive-usable-number/981/4 "2016-12-15T22:50:52Z")

</div>

Hmm, the numpy docs [really do say that](https://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.finfo.html).

More precisely, this is the smallest magnitude normal floating point number, which is available in Julia via [`realmin(Float64)`](http://docs.julialang.org/en/release-0.5/stdlib/base.html?highlight=realmin#Base.realmin).

---

<div class="post-metadata">

**Author:** ![Alvaro\_M](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@Alvaro\_M](https://discourse.julialang.org/u/Alvaro_M)\
**Post date:** [December 15, 2016, 11:03pm UTC](https://discourse.julialang.org/t/the-smallest-positive-usable-number/981/5 "2016-12-15T23:03:18Z")

</div>

It makes sense.

Thanks.

---

<div class="post-metadata">

**Author:** ![JeffreySarnoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeffreysarnoff/32/1980_2.png) [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Post date:** [December 16, 2016, 3:57am UTC](https://discourse.julialang.org/t/the-smallest-positive-usable-number/981/6 "2016-12-16T03:57:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Ju\_ska](https://avatars.discourse-cdn.com/v4/letter/j/ecd19e/32.png) [@Ju\_ska](https://discourse.julialang.org/u/Ju_ska)\
**Post date:** [November 18, 2024, 11:18am UTC](https://discourse.julialang.org/t/the-smallest-positive-usable-number/981/7 "2024-11-18T11:18:08Z")

</div>

As an update to this thread, looks like the new function is floatmin:

```julia
help?> floatmin
search: floatmin floatmax float flatten Float16 Float32 Float64 findmin Cfloat

  floatmin(T = Float64)

  Return the smallest positive normal number representable by the floating-point
  type T.

```

On a x86\_64:

```julia
julia> floatmin(Float32)
1.1754944f-38

julia> floatmin(Float64)
2.2250738585072014e-308

```
