Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 18 in printed book and digital formats -- plus a one-year subscription (beginning with 19.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 17.6 ('Xojo in Cologne')
Instant purchase and download via GumRoad!

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):

Download Icon 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 have five 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.