https://issues.dlang.org/show_bug.cgi?id=5765
RazvanN changed:
What|Removed |Added
Status|NEW |RESOLVED
Hi
Whats the status on a BigInt implementation of modular
exponentiation?
http://d.puremagic.com/issues/show_bug.cgi?id=5765
--- Comment #9 from bearophile_h...@eml.cc 2011-05-09 15:23:08 PDT ---
See a working version, and the workarounds used:
http://rosettacode.org/wiki/Ackermann_function#D
--
Configure issuemail:
http://d.puremagic.com/issues/show_bug.cgi?id=5765
--- Comment #3 from Don clugd...@yahoo.com.au 2011-03-23 03:42:32 PDT ---
OK, although I don't think that the case with Ackermann code is so bad. It's
basically giving you a compile-time warning that the function blows up very,
very easily.
http://d.puremagic.com/issues/show_bug.cgi?id=5765
--- Comment #4 from bearophile_h...@eml.cc 2011-03-23 05:55:03 PDT ---
(In reply to comment #3)
The thing I'm really worried about is this:
BigInt a, b, c;
a = (a ^^ b) % c;
This is an attempt to do modular exponentiation, which comes up
http://d.puremagic.com/issues/show_bug.cgi?id=5765
--- Comment #5 from Don clugd...@yahoo.com.au 2011-03-23 06:57:19 PDT ---
(In reply to comment #4)
(In reply to comment #3)
The thing I'm really worried about is this:
BigInt a, b, c;
a = (a ^^ b) % c;
This is an attempt to do
http://d.puremagic.com/issues/show_bug.cgi?id=5765
--- Comment #6 from bearophile_h...@eml.cc 2011-03-23 10:55:03 PDT ---
(In reply to comment #5)
That's a false consistency. T ^^ int is the common operation, not T ^^ T.
Really. BigInt ^^ BigInt isn't a BigInt. It's too big to be
http://d.puremagic.com/issues/show_bug.cgi?id=5765
--- Comment #7 from Don clugd...@yahoo.com.au 2011-03-23 13:35:05 PDT ---
(In reply to comment #6)
(In reply to comment #5)
That's a false consistency. T ^^ int is the common operation, not T ^^ T.
Really. BigInt ^^ BigInt isn't a
http://d.puremagic.com/issues/show_bug.cgi?id=5765
--- Comment #8 from bearophile_h...@eml.cc 2011-03-23 16:40:37 PDT ---
(In reply to comment #7)
They are not system languages. The comparison is irrelevant.
Well, Lisp was used plenty as a system language. D wants to be a multi-purpose
http://d.puremagic.com/issues/show_bug.cgi?id=5765
Don clugd...@yahoo.com.au changed:
What|Removed |Added
CC||clugd...@yahoo.com.au
---
http://d.puremagic.com/issues/show_bug.cgi?id=5765
--- Comment #2 from bearophile_h...@eml.cc 2011-03-22 02:29:39 PDT ---
Here n needs to be a BigInt, because of the second recursive call. So instead
of writing 2^^n you need to write BigInt(2)^^n.toInt() that's not natural (this
code will
11 matches
Mail list logo