Changes between Version 44 and Version 45 of ReplacingGMPNotes


Ignore:
Timestamp:
Jan 6, 2007 2:32:18 AM (8 years ago)
Author:
p_tanski
Comment:

colorise Haskell code

Legend:

Unmodified
Added
Removed
Modified
  • ReplacingGMPNotes

    v44 v45  
    6565        The current GMP implementation of Integer is: 
    6666{{{ 
    67 data Integer     
    68    = S# Int#              -- small integers 
    69 #ifndef ILX 
    70    | J# Int# ByteArray#   -- large integers 
    71 #else 
    72    | J# Void BigInteger   -- .NET big ints 
     67#!html 
     68<pre><font color=Purple><u>data</u></font> <font color=Green>Integer</font> 
     69   <font color=Blue>=</font> <font color=Green>S</font><font color=Blue>#</font> <font color=Green>Int</font><font color=Blue>#</font>              <font color=Red>-- small integers</font> 
     70<font color=Red>#ifndef ILX</font> 
     71   <font color=Blue>|</font> <font color=Green>J</font><font color=Blue>#</font> <font color=Green>Int</font><font color=Blue>#</font> <font color=Green>ByteArray</font><font color=Blue>#</font>   <font color=Red>-- large integers</font> 
     72<font color=Red>#else</font> 
     73   <font color=Blue>|</font> <font color=Green>J</font><font color=Blue>#</font> <font color=Green>Void BigInteger</font>   <font color=Red>-- .NET big ints</font></pre> 
    7374}}} 
    7475        where the Int# counts the number of [http://swox.com/gmp/manual/Nomenclature-and-Types.html#Nomenclature-and-Types limbs] (a GMP term referring to parts of a multi-precision number that fit into a 32 or 64 bit word, depending on the machine) and the ByteArr# is the actual array in RTS-GC memory holding the limbs.  The sign of the Int# is used to indicate the sign of the number represented by the ByteArr#.