On Thu, Apr 20, 2017 at 09:11:56PM +0200, Timon Gehr via Digitalmars-d wrote:
> On 20.04.2017 20:29, H. S. Teoh via Digitalmars-d wrote:
[...]
> > Having said that, I haven't scrutinized the performance
> > characteristics of QRat too carefully just yet -- there is probably
> > room for optimizatio
On 20.04.2017 21:18, Timon Gehr wrote:
On 20.04.2017 21:11, Timon Gehr wrote:
Update: QRat now supports ^^. :-) Integral exponents only, of course. I
also implemented negative exponents, because QRat supports division and
the same algorithm can be easily reused for that purpose.
...
Nice! :)
On 20.04.2017 21:11, Timon Gehr wrote:
Update: QRat now supports ^^. :-) Integral exponents only, of course. I
also implemented negative exponents, because QRat supports division and
the same algorithm can be easily reused for that purpose.
...
Nice! :)
It does not work with BigInt-based QRa
On 20.04.2017 20:29, H. S. Teoh via Digitalmars-d wrote:
On Thu, Apr 20, 2017 at 02:51:12PM +0200, Timon Gehr via Digitalmars-d wrote:
On 20.04.2017 03:00, H. S. Teoh via Digitalmars-d wrote:
On Thu, Apr 20, 2017 at 02:01:20AM +0200, Timon Gehr via Digitalmars-d wrote:
[...]
Yes, there is in f
On Thu, Apr 20, 2017 at 02:51:12PM +0200, Timon Gehr via Digitalmars-d wrote:
> On 20.04.2017 03:00, H. S. Teoh via Digitalmars-d wrote:
> > On Thu, Apr 20, 2017 at 02:01:20AM +0200, Timon Gehr via Digitalmars-d
> > wrote:
> > [...]
> > > Yes, there is in fact a beautifully simple way to do better
On 20.04.2017 03:00, H. S. Teoh via Digitalmars-d wrote:
On Thu, Apr 20, 2017 at 02:01:20AM +0200, Timon Gehr via Digitalmars-d wrote:
[...]
Yes, there is in fact a beautifully simple way to do better. :)
...
Ahh, so *that's* what it's all about. I figured that's what I was
missing. :-D Thank
On Thu, Apr 20, 2017 at 02:01:20AM +0200, Timon Gehr via Digitalmars-d wrote:
[...]
> Yes, there is in fact a beautifully simple way to do better. :)
>
> Assume we want to compute some power of x. With a single
> multiplication, we obtain x². Multiplying x² by itself, we obtain x⁴.
> Repeating thi
On 20.04.2017 02:01, Timon Gehr wrote:
My last post includes an implementation of this algorithm. ;)
But in that implementation I used the parameter 'a' instead of the
variable 'x' as a result of being tired, which makes it slightly more
confusing than necessary even though it is correct. Mo
On 20.04.2017 02:01, Timon Gehr wrote:
To get the formula for multiplicative inverses, one possible algorithm is:
https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm#Polynomial_extended_Euclidean_algorithm
Better reference:
https://en.wikipedia.org/wiki/Polynomial_greatest_common_div
On 19.04.2017 23:39, H. S. Teoh via Digitalmars-d wrote:
On Wed, Apr 19, 2017 at 10:47:04PM +0200, Timon Gehr via Digitalmars-d wrote:
On 19.04.2017 21:32, H. S. Teoh via Digitalmars-d wrote:
I alluded to this in D.learn some time ago, and finally decided to
take the dip and actually write the
On Wed, Apr 19, 2017 at 10:47:04PM +0200, Timon Gehr via Digitalmars-d wrote:
> On 19.04.2017 21:32, H. S. Teoh via Digitalmars-d wrote:
> > I alluded to this in D.learn some time ago, and finally decided to
> > take the dip and actually write the code. So here it is: exact
> > arithmetic with numb
On 19.04.2017 21:32, H. S. Teoh via Digitalmars-d wrote:
I alluded to this in D.learn some time ago, and finally decided to take
the dip and actually write the code. So here it is: exact arithmetic
with numbers of the form (a+b√r)/c where a, b, c are integers, c!=0, and
r is a (fixed) square-free
On Wed, Apr 19, 2017 at 07:54:02PM +, Stanislav Blinov via Digitalmars-d
wrote:
> Awesome! Congrats and thanks for sharing.
>
> On Wednesday, 19 April 2017 at 19:32:14 UTC, H. S. Teoh wrote:
>
> > Haha, it seems that the only roadblocks were related to the
> > implementation quality of std.n
Awesome! Congrats and thanks for sharing.
On Wednesday, 19 April 2017 at 19:32:14 UTC, H. S. Teoh wrote:
Haha, it seems that the only roadblocks were related to the
implementation quality of std.numeric.gcd... nothing that a few
relatively-simple PRs couldn't fix. So overall, D is still
awes
I alluded to this in D.learn some time ago, and finally decided to take
the dip and actually write the code. So here it is: exact arithmetic
with numbers of the form (a+b√r)/c where a, b, c are integers, c!=0, and
r is a (fixed) square-free integer.
Code: https://github.com/quickfur/qrat
I wrot
15 matches
Mail list logo