Jump to page: 1 28  
Page
Thread overview
When will you implement cent and ucent?
Mar 25, 2022
Murilo
Mar 25, 2022
Adam Ruppe
Mar 26, 2022
Murilo
Mar 26, 2022
Era Scarecrow
Mar 26, 2022
Murilo
Mar 26, 2022
H. S. Teoh
Mar 26, 2022
Era Scarecrow
Mar 27, 2022
Murilo
Mar 27, 2022
Sergey
Mar 26, 2022
IGotD-
Mar 28, 2022
deadalnix
Mar 29, 2022
Adam D Ruppe
Mar 29, 2022
12345swordy
Mar 29, 2022
H. S. Teoh
Mar 29, 2022
Abdulhaq
Mar 29, 2022
12345swordy
Mar 29, 2022
H. S. Teoh
Mar 26, 2022
Mike Parker
Mar 26, 2022
Era Scarecrow
Mar 26, 2022
Salih Dincer
Mar 26, 2022
Guillaume Piolat
Mar 26, 2022
Era Scarecrow
Mar 26, 2022
Walter Bright
Mar 27, 2022
Era Scarecrow
Mar 27, 2022
Salih Dincer
Mar 27, 2022
Era Scarecrow
Mar 27, 2022
user1234
Mar 27, 2022
Salih Dincer
Mar 28, 2022
Guillaume Piolat
Mar 28, 2022
deadalnix
Mar 29, 2022
Era Scarecrow
Mar 29, 2022
deadalnix
Mar 29, 2022
max haughton
Mar 29, 2022
Guillaume Piolat
Mar 29, 2022
Era Scarecrow
Mar 31, 2022
Walter Bright
Mar 31, 2022
Quirin Schroll
Apr 01, 2022
rikki cattermole
Apr 01, 2022
Tejas
Apr 01, 2022
Era Scarecrow
Apr 01, 2022
rikki cattermole
Apr 01, 2022
rikki cattermole
Mar 31, 2022
Walter Bright
Mar 31, 2022
deadalnix
Mar 31, 2022
kinke
Mar 31, 2022
max haughton
Mar 31, 2022
kinke
Mar 31, 2022
max haughton
Apr 01, 2022
Walter Bright
Apr 01, 2022
12345swordy
Apr 01, 2022
Walter Bright
Apr 01, 2022
mee6
Apr 02, 2022
Walter Bright
Apr 02, 2022
Salih Dincer
Apr 03, 2022
Salih Dincer
Feb 21, 2023
Murilo
Apr 01, 2022
deadalnix
Apr 11, 2022
user1234
Apr 11, 2022
user1234
Apr 02, 2022
Iain Buclaw
Apr 01, 2022
Walter Bright
Apr 02, 2022
Iain Buclaw
Mar 31, 2022
Johan
Mar 31, 2022
Timon Gehr
Apr 02, 2022
Iain Buclaw
Apr 02, 2022
Walter Bright
Apr 02, 2022
Iain Buclaw
Apr 02, 2022
Walter Bright
Apr 02, 2022
Iain Buclaw
Apr 10, 2022
Walter Bright
March 25, 2022

I have been waiting for years now, can't you guys just add these 2 types to the language?

March 25, 2022

What would you do with it? There's a number of alternatives available today depending what you need.

March 26, 2022

On Friday, 25 March 2022 at 23:33:45 UTC, Murilo wrote:

>

I have been waiting for years now, can't you guys just add these 2 types to the language?

Walter has plans to deprecate cent/ucent in favor of a library implementation. See the “128 bit integers” section in the summary of our last meeting here:

https://forum.dlang.org/post/qrtjqubrbuqeiffunili@forum.dlang.org

March 26, 2022

On Friday, 25 March 2022 at 23:33:45 UTC, Murilo wrote:

>

I have been waiting for years now, can't you guys just add these 2 types to the language?

I have a library i wrote a few years ago you can use. Compiled it recently and had no issues. It may need more testing. Should handle any multiple of 64bits, even odd ones. though doing 128/256 and others should be just fine.

https://github.com/rtcvb32/Side-Projects/tree/master/arbitraryint

used as import std.experimental/arbitraryint;

Though i'm not sure if i need to update it for licenses, it has been a while afterall... For now avoid using it in commercial products.

March 26, 2022

On Friday, 25 March 2022 at 23:50:39 UTC, Adam Ruppe wrote:

>

What would you do with it? There's a number of alternatives available today depending what you need.

I would perform calculation with astronomical numbers and atomic precision.

March 26, 2022

On Saturday, 26 March 2022 at 04:02:18 UTC, Murilo wrote:

>

I would perform calculation with astronomical numbers and atomic precision.

If you aren't sure what size of numbers you need, BigInt/BigNum would be better.

If you need fractions, might be more interested in using GMP, as it will give you floating precision you want.

https://gmplib.org/

float/double/real (32/64/80) allow a very large range of rough values within ranges and are built in with the FPU.

If you want a fixed int-type, then int/long/cent or others would be practical.

So question, what doesn't BigInt do that you need cent/ucent for?

March 26, 2022

On Friday, 25 March 2022 at 23:50:39 UTC, Adam Ruppe wrote:

>

What would you do with it? There's a number of alternatives available today depending what you need.

Is there any implementation similar to the C# decimal type?

March 26, 2022

On Friday, 25 March 2022 at 23:33:45 UTC, Murilo wrote:

>

I have been waiting for years now, can't you guys just add these 2 types to the language?

The code is a bit old, but it works flawlessly and has useful aliases:

https://github.com/d-gamedev-team/gfm/blob/master/integers/gfm/integers/wideint.d

March 26, 2022

On Saturday, 26 March 2022 at 11:37:28 UTC, Salih Dincer wrote:

>

On Friday, 25 March 2022 at 23:33:45 UTC, Murilo wrote:

>

I have been waiting for years now, can't you guys just add these 2 types to the language?

The code is a bit old, but it works flawlessly and has useful aliases:

https://github.com/d-gamedev-team/gfm/blob/master/integers/gfm/integers/wideint.d

I think it just need to be in a dub package one can find.

March 26, 2022

On Saturday, 26 March 2022 at 11:37:28 UTC, Salih Dincer wrote:

>

The code is a bit old, but it works flawlessly and has useful aliases:

https://github.com/d-gamedev-team/gfm/blob/master/integers/gfm/integers/wideint.d

Flawless maybe, but definitely slow when you get to division. It can only double the size of integers.

If memory serves me right, it uses shift and subtraction for division, but it also uses 2 lower types so if you do say a 256bit type, it creates and uses 2 128 bit types, which uses 2 64 bit types to do the job.

« First   ‹ Prev
1 2 3 4 5 6 7 8