3 ms·
What you want is range subtypes of signed integers.
by barrkel 5y ago
What you want is range subtypes of signed integers.
- kazinator 5y agoImportant: without silent conversion. Languages like Pascal and Ada require explicit conversions in more places to make that sort of thing useful.
- pyjarrett 5y agoIt also allows creating type checked "new" numerical types for semantics purposes to help improve interfaces. This helps prevent things like accidentally passing an integer in the wrong units for example. Two of the worst offenders I've seen of this is: "Is this uint64_t (or float) "dt" parameter in ticks, seconds, milliseconds, microseconds or nanoseconds?" and "Is this angle parameter in radians or degrees?"