3 ms·
You forgot 0, -1, null, "1".
by Cpoll 10mo ago
You forgot 0, -1, null, "1".
- bluGill 10mo agoSince I work in a strongly typed languages the last two will fail to compile and are thus not worth the bother - those who don't have that luxury of course need to test the edge cases that apply to them. The first are maybe, in my experience they are rarely a problem, but we need to go from the abstract to the particular algorithm before we can have a discussion on if they are potentially a problem or not.
- OptionOfT 10mo agoIf you're using Rust you can push it one level further: use a NonZeroU*. More than that and you'll need nightly for now: https://docs.rs/ranged_integers/latest/ranged_integers/ https://docs.rs/ranged_integers/latest/ranged_integers/