Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changes between Version 33 and Version 34 of ChapterMath

Show
Ignore:
Author:
Don Clugston (IP: 195.243.104.114)
Timestamp:
08/25/08 09:51:46 (16 years ago)
Comment:

Basic docs for BigInt?

Legend:

Unmodified
Added
Removed
Modified
  • ChapterMath

    v33 v34  
    218218 
    219219'''Never''' store a pointer as an integer payload inside a NaN. The garbage collector will not be able to find it! 
     220 
     221[[docs(math.BigInt,tango.math.BigInt.html,h2)]] 
     222 
     223The built-in integral types are have inadequate precision for certain applications, such as high-precision mathematics and cryptography. Tango provides arbitrary-precision arithmetic using the BigInt type, which is capable of performing calculations with thousands of digits of precision. Generally speaking,  BigInt can be used as a drop-in replacement for {{{int}}} or {{{long}}}. 
     224To achieve this, BigInt uses value semantics, implemented in D1.0 using Copy-on-Write. Unfortunately, this results in the creation of many temporary heap objects (a problem which will not occur in D2.0). 
     225 
     226BigInt is intended to provide excellent performance for small to moderate numbers of digits (up to a few thousand decimal digits). Highly optimised assembly routines are used for the most widely-used processors. 
     227For extremely large numbers, or for relatively obscure processors, consider using GMP (http://www.gmplib.org/). 
    220228 
    221229[[docs(math.Bracket,tango.math.Bracket.html,h2)]]