Allows you to add or subtract numbers of any number of digits, without losing any precision. The result is saved as a string.
Note: Very large or very small numbers are compressed into scientific notation, but these can still only be 6 digits long, in total.
|Syntax:||[numbers] call fn_vbs_highPrecisionAdd|
|Return Value:||String - Sum of the inputs, in full digit precision.|
When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.
[100,.0001] call fn_vbs_highPrecisionAdd // Returns "100.0001" ["-123456789",-0.123456,"-0.000000789"] call fn_vbs_highPrecisionAdd // Returns "-123456789.123456789"
- Remember that the results are only as good as the inputs. For example, if you input the number 1234567, VBS will round that number to 123457
- this function gets to it. If your individual
- need to be over 6 digits of precision, you need to pass them as a string ("1234567").
- 04:20, 14 November 2009 (CET)