anchor.diff:  
   unit Velthuis.BigDecimals;
   
  -{$IF CompilerVersion >= 24.0}
  +(* TODO: BigDecimals are ssslllooowww. This piece of code, with CIterations = 5*1000*1000,
  +
  +    SetLength(arr, CIterations);
  +    pi := '3.14159';
  +    for I := 0 to High(arr) do
  +      arr[I] := BigDecimal(I);
  +    for I := 0 to High(arr) do
  +      arr[I] := arr[I] * pi / (pi * BigDecimal(I) + BigDecimal.One);
  +
  +  is 500 times(!) slower than the Double equivalent. That is extremely slow.
  +  Note that simplyfying this to do BigDecimal(I) * pi only once will only take away 1% of that.
  +  It is crucial to find out what makes this code so terribly slow.
  +
  +  Note: probably BigInteger.DivMod is the slow part.
  +
  +  Note: It might make sense to use a NativeInt to hold the FValue of small BigDecimals, instead
  +  of always BigIntegers.
  +  It might also make sense to make BigInteger.DivMod a lot faster for small values.
  +*)
  +
  +{$IF CompilerVersion >= 24.0}   // Delphi XE3
     {$LEGACYIFEND ON}
   {$IFEND}
   
  -{$IF CompilerVersion >= 22.0}
  +{$IF CompilerVersion >= 22.0}   // Delphi XE
     {$CODEALIGN 16}
     {$ALIGN 16}
   {$IFEND}
   
  -{$IF CompilerVersion >= 21.0}
  +{$IF CompilerVersion >= 21.0}   // Delphi 2010
     {$DEFINE HASCLASSCONSTRUCTORS}
   {$IFEND}
   
  
positive.code:     Lo: Cardinal;
      Hi: Integer;
    end;
  begin
    if FValue.IsZero then
      Result := 1
    else
    begin
      // 1292913986 is Log10(2) * 1^32.
      Result := CardRec(FValue.BitLength * UInt64(1292913986)).Hi;
      if (GetPowerOfTen(Result) <= Abs(FValue)) or (Result = 0) then
        Inc(Result);
      FPrecision := Result;
  
negative.code:     class function GetPowerOfTen(N: Integer): BigInteger; static;
  
      // Initialize or reset values of scale and precision to 0.
      procedure Init; inline;
  
      // Checks if the NewScale value is a valid scale value. If so, simply returns NewScale. Otherwise, raises
      // an appropriate exception.
      class function RangeCheckedScale(NewScale: Int32): Integer; static;
  
      // Only allows 'e' or 'E' as exponent delimiter for scientific notation output.
  