When will you implement cent and ucent?

Salih Dincer salihdb at hotmail.com
Sun Apr 3 00:55:38 UTC 2022


On Saturday, 2 April 2022 at 23:12:27 UTC, Salih Dincer wrote:
> I wish I could a little support but I haven't gotten very far 
> in D Language yet.
>
I don't know how to add it to Github. A small contribution, they 
work:

**Lines,70-77**
```d
// ++Int128
     Int128 opUnary(string op)() const
         if (op == "++")
     {
         return Int128(inc(this.data));
     }
// --Int128
     Int128 opUnary(string op)() const
         if (op == "--")
     {
         return Int128(dec(this.data));
     }
//...
unittest {
     Int128 idTest;

     idTest += ulong.max;// hi = 1, lo = 0->
     assert(++idTest == Int128(1, 0));

     idTest = ++idTest;// hi = 0, lo = ulong.max->
     assert(--idTest == Int128(0, -1));
}
```
SDB at 79


More information about the Digitalmars-d mailing list