http://d.puremagic.com/issues/show_bug.cgi?id=7013

           Summary: Mutable interface for BigInts
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-11-25 16:52:13 PST ---
When multi-precision numbers become large or quite large, the time spent
managing their memory risk becoming an issue. To improve this situation the GNU
multiprecision integer library allows for mutable numbers, that allow in-place
modification.

There was a discussion about offering a mutable interface for the General
Multiprecision PYthon project (GMPY) numbers too (see "Mutability... but not
for now"):
http://gmpy.sourceforge.net/

So maybe it's useful to add a mutable interface to Phobos bigints. A simple way
to do it is to add a "mutable" attribute that supports just few in-place
operations like += -= *= /= ^^= &= |= (but not other operations like == that
don't need mutability, to keep the situation semantically more clean):

auto x = BigInt("...");
x.mutable += BigInt("...");

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to