When will you implement cent and ucent?

Iain Buclaw ibuclaw at gdcproject.org
Sat Apr 2 10:18:39 UTC 2022


On Monday, 28 March 2022 at 19:35:10 UTC, deadalnix wrote:
> On Monday, 28 March 2022 at 18:37:27 UTC, Guillaume Piolat 
> wrote:
>> On Saturday, 26 March 2022 at 19:30:13 UTC, Walter Bright 
>> wrote:
>>> https://dlang.org/phobos/core_int128.html
>>
>> I tried to find faults in its divide and modulo so that I 
>> could rant about wideint.d being rewritten, but actually 
>> core.int128 seems to be better and correct (possibly more 
>> correct with negative modulo even). :)
>>
>> So now it's all about adding the operator overloads, and done 
>> with that particular complaint!
>
> With LDC 1.27.1 :
>
> ```d
> Cent foobar(Cent a, Cent b) {
>     return mul(a, b);
> }
> ```
>
> Codegen:

[--snip--]

Being free functions, LDC is free to recognize them as intrinsics 
and do the desirable thing here.


More information about the Digitalmars-d mailing list