55
Xnumbers Tutorial
36
Relative rounding - significant digits 15.
4.5399929762484851535591E-5
4.53999297624849E-05
1.0015629762484851535591E-6
⇒
1.00156297624849E-06
0.539929762484851535591E-12
5.39929762484852E-13
Mop-Up - Error limit 1E-15.
31415926.53589793238462643
31415926.53589793238462643
-1.00E-15
⇒
0
5.78E-16
0
-1.40E-18
0
Note that the function mopup is used overall for improving the readability. The cells having
values greater than the limit are not modified.
Macro X-Converter
This macro
1
(*) converts a well formed Excel formula to the equivalent in terms of Xnumber
multiprecision functions (xadd, xmult, etc.).
The advantage over x-evaluate is that the code can be debugged in normal excel using small
values
and in a familiar form. When the spreadsheet works it is ' converted to using nested x-calls for
the precision work. The intention is to tag the conversion onto the copy worksheet function ' so
that you end up with a multi-precision copy of the original.
Its main features are:
• converts a range of cells directly on site or in a new worksheet.
• skips cells having functions not convertible.
• skips array functions except MINVERSE and MMULT that are substituted with the
correspondent x-functions xMatInv and xMatMult.
• Errors (if any ) are shown on the panel
The digits parameter can be set in 4 different ways:
1) an integer number i.e. 30
2) a fixed reference of a cell, i.e. $A$1
3) a name of a cell, i.e. "digits"
4) simply nothing. In that case all the x-functions use the internal default = 30
Of course not all the Excel Functions can be converted. The list of the Excel functions
2
converted is:
* , / , + , - , ^ , ABS , ACOS , ACOSH , ASIN , ASINH , ATAN , ATANH , AVERAGE
, COMBIN , COS , COSH , EXP , FACT , INT , LN , LOG , MDETERM , MINVERSE ,
MMULT , MOD , PI , PRODUCT , ROUND , SIN , SINH , SQRT , STDEV , STDEVP , SUM
, TAN , TANH , TRUNC , VAR , VARP
1
The conversion engine of this macro was originally developed by John Jones in an smart m4 macro language which
makes the VB native j-code more simple (!) to write. It appears in this package thanks to his courtesy
2
The functions are indicated with their original English names, that usually are different from the local names.