# Pre-RFC: Generic integers (uint\<N\> and int\<N\>)

**URL:** <https://internals.rust-lang.org/t/pre-rfc-generic-integers-uint-n-and-int-n/7641>\
**Category:** language design\
**Created:** [May 25, 2018, 3:41am UTC](https://internals.rust-lang.org/t/pre-rfc-generic-integers-uint-n-and-int-n/7641 "2018-05-25T03:41:00Z")\
**Posts on this page:** 1\
**Showing post:** 36

<div class="post-metadata">

**Author:** ![scottmcm](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/scottmcm/32/2355_2.png) [@scottmcm](https://internals.rust-lang.org/u/scottmcm)\
**Post date:** [May 28, 2018, 4:17am UTC](https://internals.rust-lang.org/t/pre-rfc-generic-integers-uint-n-and-int-n/7641/36 "2018-05-28T04:17:34Z")

</div>

> [@clarfonthey](#):
>
> Technically, `int<N>` doesn’t break the invariant that it lies between the range [-2n-1, 2n-1-1], as zero is the only integer in the range [-½, ½].

Excellent point! I'd written it out with ⌈⌉, but that looked terrible, so deleted it.

nit: You mean [−2n-1, 2n-1), since the formula you have actually generates [-½,-½].

soapbox: Once again, half-open ranges are superior to trying to futz about with ±1 😉

---

_[View the full topic](https://internals.rust-lang.org/t/pre-rfc-generic-integers-uint-n-and-int-n/7641)._
