digitalmars.D - Question on multiprecision types
- SteveGuo (4/4) Aug 05 2013 Does D support types like cpp_int or cpp_rational in
- SteveGuo (2/2) Aug 05 2013 Is there a plan to support those kind of types? If support, is it
- bearophile (10/12) Aug 06 2013 That will not have a core language support, beside perhaps
- SteveGuo (2/11) Aug 06 2013 Thanks for replying:) I have to choose c++ on my project. Though
- bearophile (4/5) Aug 06 2013 Are std.bigint not efficient enough?
- SteveGuo (2/5) Aug 06 2013 std.bigint, I think it's an equevelent of cpp_int, but My project
- bearophile (6/8) Aug 06 2013 A rational was implemented in D by several persons, it's easy. Of
- SteveGuo (1/6) Aug 06 2013 That's great!
- H. S. Teoh (6/10) Aug 05 2013 There's std.bigint, but I don't know whether there's a rational library
Does D support types like cpp_int or cpp_rational in boost::multiprecision? D is designed directly mapped to hardware for speed reason. But in some cases, we do need types like cpp_int or cpp_rational support.
Aug 05 2013
Is there a plan to support those kind of types? If support, is it a core language feature or library support?
Aug 05 2013
SteveGuo:Is there a plan to support those kind of types? If support, is it a core language feature or library support?That will not have a core language support, beside perhaps cent/ucent. At the moment there are no plans for library support, but eventually in some years fixed-size multi-precision integers will be good to have in Phobos, just like several other things, like nD packed arrays (http://pempek.net/articles/2013/08/03/packedarray-random-access-array-tightly-packe -unsigned-integers/ ) etc. Bye, bearophile
Aug 06 2013
That will not have a core language support, beside perhaps cent/ucent. At the moment there are no plans for library support, but eventually in some years fixed-size multi-precision integers will be good to have in Phobos, just like several other things, like nD packed arrays (http://pempek.net/articles/2013/08/03/packedarray-random-access-array-tightly-packe -unsigned-integers/ ) etc. Bye, bearophileThanks for replying:) I have to choose c++ on my project. Though I love D.
Aug 06 2013
SteveGuo:I have to choose c++ on my project.Are std.bigint not efficient enough? Bye, bearophile
Aug 06 2013
Are std.bigint not efficient enough? Bye, bearophilestd.bigint, I think it's an equevelent of cpp_int, but My project has to use cpp_rational
Aug 06 2013
SteveGuo:std.bigint, I think it's an equevelent of cpp_int, but My project has to use cpp_rationalA rational was implemented in D by several persons, it's easy. Of the few problems is implement an efficient GCD among bigints (that sooner or later will be needed in std.bigint). Bye, bearophile
Aug 06 2013
A rational was implemented in D by several persons, it's easy. Of the few problems is implement an efficient GCD among bigints (that sooner or later will be needed in std.bigint). Bye, bearophileThat's great!
Aug 06 2013
On Tue, Aug 06, 2013 at 07:43:29AM +0200, SteveGuo wrote:Does D support types like cpp_int or cpp_rational in boost::multiprecision? D is designed directly mapped to hardware for speed reason. But in some cases, we do need types like cpp_int or cpp_rational support.There's std.bigint, but I don't know whether there's a rational library yet. But you can probably use BigInt to implement one. T -- Help a man when he is in trouble and he will remember you when he is in trouble again.
Aug 05 2013