Article Preview
Buy Now
FEATURE
Big Numbers and Large Numbers
How you can use the BigNumberMBS and LargeNumberMBS class in Xojo
Issue: 17.6 (November/December 2019)
Author: Stefanie Juchmes
Author Bio: Beginner
Article Description: n>No description availabl
Article Length (in bytes): 8,095
Starting Page Number: r>
Article Number: 17606
Resource File(s):
project17606.zip Updated: 2019-11-01 12:16:02
Related Link(s): None
Excerpt of article text...
Sometimes you need numbers that offer a higher precision than the existing data types in Xojo do. You can solve this problem with large numbers and big numbers from our MBS Xojo DataTypes Plugin.
Big number
Our
BigNumberMBS
class has a floating point number with 320 bits, precise for over 100 digits before the decimal point!If you compare it to a normal
double
value, you havefive times the number of bits. Since version 16.5, this class is included in the MBS Xojo DataTypes Plugin.For example, in Figure 1, we can calculate the following calculation with high precision with big numbers and get the correct results.
We see that the result with double values is wrong, whereas the result with big number values is correct. Well, double values have only about 15 digits of precision, so rounding errors show after the last precise digits.
...End of Excerpt. Please purchase the magazine to read the full article.