Re: Arbitrary precision decimal numbers

2022-08-10 Thread Tejas via Digitalmars-d-learn
On Wednesday, 10 August 2022 at 14:11:04 UTC, Ruby The Roobster wrote: On Saturday, 6 August 2022 at 13:20:19 UTC, Sergey wrote: On Thursday, 4 August 2022 at 13:01:30 UTC, Ruby The Roobster wrote: Is there any implementation in phobos of something similar to BigInt but for non-integers as well

Re: Arbitrary precision decimal numbers

2022-08-10 Thread Ruby The Roobster via Digitalmars-d-learn
On Saturday, 6 August 2022 at 13:20:19 UTC, Sergey wrote: On Thursday, 4 August 2022 at 13:01:30 UTC, Ruby The Roobster wrote: Is there any implementation in phobos of something similar to BigInt but for non-integers as well? If there isn't is there a dub package that does this, and if so, whi

Re: Arbitrary precision decimal numbers

2022-08-06 Thread Sergey via Digitalmars-d-learn
On Thursday, 4 August 2022 at 13:01:30 UTC, Ruby The Roobster wrote: Is there any implementation in phobos of something similar to BigInt but for non-integers as well? If there isn't is there a dub package that does this, and if so, which one? Also you could find usefull such projects: http:

Re: Arbitrary precision decimal numbers

2022-08-06 Thread Dom Disc via Digitalmars-d-learn
On Saturday, 6 August 2022 at 11:25:28 UTC, Dom Disc wrote: I once did a completely inline implementation of xlcmplx Sorry, one function is NOT inline: ```C class xlcmplx { uint32 Decimal(char* s, uint32 max) const; // string representation } ``` But you should forget about that, because D

Re: Arbitrary precision decimal numbers

2022-08-06 Thread Dom Disc via Digitalmars-d-learn
On Friday, 5 August 2022 at 14:25:39 UTC, Ruby The Roobster wrote: I'm currently working on an arbitrarily precise division algortihm based off of the done-by-hand standard algorithm, but I need to get it to work for complex numbers, [which it's just not](https://forum.dlang.org/post/czidpbdyws

Re: Arbitrary precision decimal numbers

2022-08-05 Thread Ruby The Roobster via Digitalmars-d-learn
On Friday, 5 August 2022 at 14:11:10 UTC, frame wrote: On Friday, 5 August 2022 at 14:03:36 UTC, Ruby The Roobster wrote: Also, what about division and exponentiation. You can't just forward them to BigInt and get a good result, BigInt will just round to an integer for these two. There are

Re: Arbitrary precision decimal numbers

2022-08-05 Thread frame via Digitalmars-d-learn
On Friday, 5 August 2022 at 14:03:36 UTC, Ruby The Roobster wrote: Also, what about division and exponentiation. You can't just forward them to BigInt and get a good result, BigInt will just round to an integer for these two. There are divMod() and powmod() for BigInt but I have no idea how

Re: Arbitrary precision decimal numbers

2022-08-05 Thread Ruby The Roobster via Digitalmars-d-learn
On Friday, 5 August 2022 at 14:00:32 UTC, frame wrote: On Thursday, 4 August 2022 at 13:01:30 UTC, Ruby The Roobster wrote: Is there any implementation in phobos of something similar to BigInt but for non-integers as well? If there isn't is there a dub package that does this, and if so, which

Re: Arbitrary precision decimal numbers

2022-08-05 Thread frame via Digitalmars-d-learn
On Thursday, 4 August 2022 at 13:01:30 UTC, Ruby The Roobster wrote: Is there any implementation in phobos of something similar to BigInt but for non-integers as well? If there isn't is there a dub package that does this, and if so, which one? We have this: https://code.dlang.org/search?q=de