Thread overview
I need cent and ucent to be implemented soon
May 04
Murilo
May 04
Alex
May 04
user1234
May 04
Alex
May 04
user1234
May 04
Murilo
May 04
Hi guys, I am writing a program what will use very big numbers, when will you guys implement cent and ucent?
May 04
On Saturday, 4 May 2019 at 04:28:55 UTC, Murilo wrote:
> Hi guys, I am writing a program what will use very big numbers, when will you guys implement cent and ucent?

Why BigInt doesn't fit?
https://dlang.org/phobos/std_bigint.html
May 04
On Saturday, 4 May 2019 at 11:03:59 UTC, Alex wrote:
> On Saturday, 4 May 2019 at 04:28:55 UTC, Murilo wrote:
>> Hi guys, I am writing a program what will use very big numbers, when will you guys implement cent and ucent?
>
> Why BigInt doesn't fit?
> https://dlang.org/phobos/std_bigint.html

128 bits int are supposed to be a fast, fixed size, standard integer type. BigInt is more designed for arbitrary length. Also GCC and LLVM-based backends could support them easily. DMD implementation would be more something like d templates funcs (since hooks are being left away) in druntime (likely in object.d) with asm inside...
May 04
On Saturday, 4 May 2019 at 12:00:08 UTC, user1234 wrote:
> 128 bits int are supposed to be a fast, fixed size, standard integer type.

Hey, sorry for degrading this to a learn forum section and I promise I stop posting such silly questions here very soon. But just out of interest: Isn't this true, only in the case where such ints are native to the architecture? If so, and if you see a machine of such architecture in the wild, could you post a link here?
May 04
On Saturday, 4 May 2019 at 16:15:33 UTC, Alex wrote:
> On Saturday, 4 May 2019 at 12:00:08 UTC, user1234 wrote:
>> 128 bits int are supposed to be a fast, fixed size, standard integer type.
>
> Hey, sorry for degrading this to a learn forum section and I promise I stop posting such silly questions here very soon.

Good initiative.

> But just out of interest: Isn't this true, only in the case where such ints are native to the architecture? If so, and if you see a machine of such architecture in the wild, could you post a link here?

SSE regs are wide enough...

Also in a far past a similar situation existed with 64 bits int on x86 CPUs, were machine word was 32 bits. The int was either passed as a struct or split and passed in two regs and then some special intrinsic functions were used for the different ops.

Technically nothing prevents to have them, it's just that someone has to do the work. There's a good pile of operation to implement: arithetic, bitwise... some stuff with the implicit conversions too, etc.

As said with DMD this won't be as good as with other compilos which have intrinsics for all the ops (AFAIU).
May 04
On Saturday, 4 May 2019 at 11:03:59 UTC, Alex wrote:
> On Saturday, 4 May 2019 at 04:28:55 UTC, Murilo wrote:
>> Hi guys, I am writing a program what will use very big numbers, when will you guys implement cent and ucent?
>
> Why BigInt doesn't fit?
> https://dlang.org/phobos/std_bigint.html

BigInt takes too long. I need something as fast as the primitive types.