# A fun tool to explore or teach floating point numbers

**URL:** <https://fortran-lang.discourse.group/t/a-fun-tool-to-explore-or-teach-floating-point-numbers/5333>\
**Category:** Uncategorized\
**Created:** [March 4, 2023, 12:05pm UTC](https://fortran-lang.discourse.group/t/a-fun-tool-to-explore-or-teach-floating-point-numbers/5333 "2023-03-04T12:05:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vmagnin](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/vmagnin/32/28_2.png) [@vmagnin](https://fortran-lang.discourse.group/u/vmagnin)\
**Post date:** [March 4, 2023, 12:05pm UTC](https://fortran-lang.discourse.group/t/a-fun-tool-to-explore-or-teach-floating-point-numbers/5333/1 "2023-03-04T12:05:41Z")

</div>

I have found this site on Mastodon:

> **[Float Exposed](https://float.exposed/)**
>
> Floating point format explorer – binary representations of common floating point formats.

Very interesting for teaching what is a floating point real! You can for example click on each bit and show how is represented Infinity or NaN, etc.

---

<div class="post-metadata">

**Author:** ![shahmoradi](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/shahmoradi/32/3151_2.png) [@shahmoradi](https://fortran-lang.discourse.group/u/shahmoradi)\
**Post date:** [March 4, 2023, 5:11pm UTC](https://fortran-lang.discourse.group/t/a-fun-tool-to-explore-or-teach-floating-point-numbers/5333/2 "2023-03-04T17:11:11Z")

</div>

Super helpful, thanks for sharing.

---

<div class="post-metadata">

**Author:** ![vmagnin](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/vmagnin/32/28_2.png) [@vmagnin](https://fortran-lang.discourse.group/u/vmagnin)\
**Post date:** [March 4, 2023, 5:17pm UTC](https://fortran-lang.discourse.group/t/a-fun-tool-to-explore-or-teach-floating-point-numbers/5333/3 "2023-03-04T17:17:29Z")

</div>

At the bottom of the page, you can click on the name of the author and be redirected to this article on his blog:

> **[Exposing Floating Point – Bartosz Ciechanowski](https://ciechanow.ski/exposing-floating-point/)**
>
> In depth explanation of floating point format.

See also his other articles:  
[https://ciechanow.ski/archives/](https://ciechanow.ski/archives/)

Very beautiful blog!

---

<div class="post-metadata">

**Author:** ![art-rasa](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@art-rasa](https://fortran-lang.discourse.group/u/art-rasa)\
**Post date:** [March 5, 2023, 12:15pm UTC](https://fortran-lang.discourse.group/t/a-fun-tool-to-explore-or-teach-floating-point-numbers/5333/4 "2023-03-05T12:15:43Z")

</div>

Thanks for sharing. I find it strangely intriguing and philosophical how the number 1.0 and “Infinity” differ by just one bit.

```auto
1.0: 0011 1111 1000 0000 0000 0000 0000 0000
Inf: 0111 1111 1000 0000 0000 0000 0000 0000

```

---

<div class="post-metadata">

**Author:** ![vmagnin](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/vmagnin/32/28_2.png) [@vmagnin](https://fortran-lang.discourse.group/u/vmagnin)\
**Post date:** [March 5, 2023, 1:48pm UTC](https://fortran-lang.discourse.group/t/a-fun-tool-to-explore-or-teach-floating-point-numbers/5333/5 "2023-03-05T13:48:51Z")

</div>

> [@art-rasa](#):
>
> I find it strangely intriguing and philosophical how the number 1.0 and “Infinity” differ by just one bit.

With that fact and e^{\mathrm i\pi}+1=0, you “hold Infinity in the palm of your hand”. 😵‍💫

A more prosaic view is that it is so because the first 1 of a not null significand is implicit in IEEE 754 (the art of gaining 1 bit!).

---

<div class="post-metadata">

**Author:** ![vmagnin](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/vmagnin/32/28_2.png) [@vmagnin](https://fortran-lang.discourse.group/u/vmagnin)\
**Post date:** [March 5, 2023, 2:07pm UTC](https://fortran-lang.discourse.group/t/a-fun-tool-to-explore-or-teach-floating-point-numbers/5333/6 "2023-03-05T14:07:49Z")

</div>

With 32 bits:  
42 is `0 10000100 01010000000000000000000`. No fun… 🙄
