3 ms·
Creating a type that is defined as being between one and zero would be more helpful and then the name can reflect the usage of the value
by darepublic 6y ago
Creating a type that is defined as being between one and zero would be more helpful and then the name can reflect the usage of the value
- db48x 6y agoSure, but then you still have to name the type.
- sanjay_316 6y agoUnitInterval Represent it internally as either fixed or floating point and divide to convert in and out if needed. With a nice type system you could even genericize the type over integer constants
- db48x 6y agoOthers have already said it, but that name is for a type whose values are intervals, not a type whose values are numbers within an interval.