WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.


Huge Math

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Huge Numbers and Excel

 Keywords: Large Huge Numbers Float Floating Point Excel Precision Decimal 


I have a very large floating point number that I need to calculate. I need the results to match Excels results. I understand that I need to use the Huge math extender for the arithmetic. However I am getting different results from Excel and the Huge math extender. Can you explain why?


There may be times that the value that you see in WinBatch or Excel do not equal the value that you think that it should be. There are two possible causes.
  1. The numbers are not 'displayed' to their full values.
  2. A computer design issue.
Neither issues are with the design of WinBatch or Excel.

In order to get the Huge Math extender to return exactly what Excel reuturns you will need to know the settings and limitations of Excel.

Excel stores numeric values as "Double Precision Floating Point" numbers, or "Doubles" for short. These are 8-byte variables that can store numbers accurate to approximately 15 decimal places. You may have only two decimal places displayed on the worksheet, but the underlying value has the full 15 decimal places.

In order to match these results using the Huge math extender you will need to call huge_SetOptions.

UsePrecision = @TRUE ; Fixed precision
MaxiDivPrecision = 0
FixedPrecision = 15
AddSeperator = @TRUE
SeperatorFormat = @FALSE
Decimal = 0
Thousands = 0
;huge_SetOptions (UsePrecision, MaxiDivPrecision, FixedPrecision, AddSeperator, SeperatorFormat, Decimal, Thousands)
a = "38363.99"
b = "235313362.64"
c = huge_Divide(a, b)
Pause('Excel result: 0.000163034','WinBatch result: ': c)

Article ID:   W17578
Filename:   Huge Numbers and Excel.txt
File Created: 2017:07:28:13:58:30
Last Updated: 2009:10:01:10:57:57