Ask Your Question

# numbers > 2.8 billion?

How can I enable very large integers in Calc?

edit retag close merge delete

## Comments

Note: I notice I can get larger than 2.8 billion, but not much. I need trillions and beyond!!

## 3 Answers

Sort by » oldest newest most voted

@JosephFG, already tried to format and increase the column width, before typing the billions more

As long as you only ned to show and store the numbers in any representation, you can use texts consisting of decimal digits and representing numbers as if printed. Calc accepts 65535 characters per cell. That should be enough even if you use a dyadic representation.
However, neither Calc nor common hardware support calculations for that kind of numbers.
Hardware may handle 64-bit integers (signed or unsigned). LibreOffice Basic only supports 32-bit integer types, and Calc uses IEEE 754 Double for all kinds of numbers. That's a 64-bit floating-point format which, if used for integers, can represent values up to about 15 decimal digits exactly (52-bit mantissa).
Beyond that you cannot "enable" anything in Calc.
For calculations with arbitrary precision (or integers of arbitrary length) you need mathematical software like Mathematica or Maple or, if it should be free and open, Maxima, e.g.

more

## Comments

Thanks, I will try one of those.

(@ajlittoz already told it in other words.)
Just to put it completely clear: It's not a question of the order of magnitude Double format can handle the range of scaling factors from about 10^-308 through 10^+308. Thats a lot. The quesetion is if a precision of 52 significant bits is sufficient.

Developers could answer better than I can.

It is likely that integer arithmetic is done with 32-bit integer, allowing for a maximum absolute value of ~2.1 10^9. Numbers larger than this limit are handled with iEEE 754 floating point format. It is likely that "double" type was chosen for consistency. This length allows for 53-bits precision. Provided, you don't require too large a magnitude, you can consider you have a slightly larger integer (the exponent does not cause flushing digits out of the significand). You must also take care of not creating non-integer numbers, i.e. a fractionary part.

It is then possible to circumvent the limitations of pure integer range but you must be very cautious and make a thourough numerical analysis of your formulas to avoid all pitfalls with floating-point arithmetic.

If you want to reliably compute large numbers, try using multiprecision packages or applications. In case you want to stay with Calc, consider your numbers as polynomials or billion-radix numbers and use 2 cells to represent them. You'll have to manage overflow yourself. Addition and subtraction are easy; beware for multiplication and division (you may have to reduce the radix to avoid overflow).

more

## Comments

Now there is an interesting idea. I will have to think about this. Thanks.

## Stats

Asked: 2019-05-12 20:03:43 +0200

Seen: 40 times

Last updated: May 13