[Dlang-internal] I need cent and ucent to be implemented soon
Walter Bright
newshound2 at digitalmars.com
Sat Dec 25 04:17:11 UTC 2021
On 12/24/2021 4:35 PM, ryuukk_ wrote:
> I didn't know what ``cent`` was, then someone in the IRC mentioned ``big int``
`cent` is a 128 bit int. Cent for "100".
> I think that is one of the baggage from C that it not worth keeping for the long
> term
It doesn't come from C.
> If were to add a new type, why not start fresh and put some consistency, i
> propose doing what C++/Rust/Swift/Zig and other language did, prefix with
> integer/unsigned following by the size
The size postfix is fine for the first week learning the language, then it
becomes annoying:
1. visual noise
2. takes many words to speak it
3. touch-typing doesn't work well with it
4. takes longer to type it
The size postfixes came about (I suspect) because C sizes are indeterminate.
They are determinate in D, a very different situation.
D is consistent in that all unsigned integers have a `u` prefix. Much more
concise than `unsigned `.
More information about the Dlang-internal
mailing list