# \[Pre-RFC?\] NonNaN type

**URL:** <https://internals.rust-lang.org/t/pre-rfc-nonnan-type/8418>\
**Category:** libs\
**Created:** [September 17, 2018, 2:50am UTC](https://internals.rust-lang.org/t/pre-rfc-nonnan-type/8418 "2018-09-17T02:50:39Z")\
**Posts on this page:** 1\
**Showing post:** 31

<div class="post-metadata">

**Author:** ![burakumin](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/burakumin/32/1838_2.png) [@burakumin](https://internals.rust-lang.org/u/burakumin)\
**Post date:** [September 18, 2018, 7:44pm UTC](https://internals.rust-lang.org/t/pre-rfc-nonnan-type/8418/31 "2018-09-18T19:44:05Z")

</div>

> [@kornel](#):
>
> so everything else that IEEE float supports is a baggage for me.
> 
> The problem of /0 introducing `Inf` is tough

You had discussed this in [Avoiding PartialOrd problems by introducing fast finite floating-point types - #45 by johannesvollmer](https://internals.rust-lang.org/t/avoiding-partialord-problems-by-introducing-fast-finite-floating-point-types/5376/45) and I'm still wondering if specific floats with _limited range_ could not meet your expectation (although unfortunately not @LateNiteMartyParty's). @Ixrec reminded that:

> [@Ixrec](#):
>
> There is no nice, clean proper subset of f32 or f64 values that’s closed under basic arithmetic.

But there are interesting subsets that could be made closed under _lacunary_ basic arithmetic. Floats inside `[+0.0, +Inf]` are closed under addition and can be made closed under multiplication and division (by adapting some rules like `+0.0 / +0.0 == +0.0 * +Inf == +Inf / +Inf = +Inf`). Floats inside `[+0.0, +1.0]` are closed under multiplication and are generally a boolean algebra.

**Edit** : typo `[+0.0, +Inf]` =\> `[+0.0, +1.0]`

---

_[View the full topic](https://internals.rust-lang.org/t/pre-rfc-nonnan-type/8418)._
