You can do that in rust, there’s even a package for it. It will destroy your compile times though.
In the future we’ll have const generics that let you express it directly without that shenanigans.
In the future we’ll have const generics that let you express it directly without that shenanigans.
type jump_by_tenth is delta 0.1 range 1.0 .. 99.0;ETA: I'm not completely correct. Ada could have used something akin to 2-complement overflow handling, that is forcing every operation on a range to have a result in the same range, but it introduces runtime overhead too.