en fr

Sysquake Pro – Table of Contents

Sysquake – Table of Contents

Sysquake for LaTeX – Table of Contents

Long integers

This section describes functions which support long integers (longint), i.e. integer numbers with an arbitrary number of digits limited only by the memory available. Some base functions have been overloaded: new definitions have been added and are used when at least one of their arguments is of type longint. These functions are listed in the table below.

FunctionOperatorPurpose
absabsolute value
charconversion to string
dispdisplay
doubleconversion to floating-point
gcdgreatest common divisor
lcmleast common multiple
minus-subtraction
mldivide\left division
mpower^power
mrdivide/right division
mtimes*multiplication
plus+addition
remremainder
uminus-negation
uplus+no operation

Functions

longint

Creation of a long integer.

Syntax

li = longint(i)
li = longint(str)

Description

longint(i) creates a long integer from a native LME floating-point number. longint(str) creates a long integer from a string of decimal digits.

Examples

longint('1234567890')
  1234567890
longint(2)^100
  1267650600228229401496703205376

13th Mersenne prime:

longint(2)^521-1
  6864797660130609714981900799081393217269
  4353001433054093944634591855431833976560
  5212255964066145455497729631139148085803
  7121987999716643812574028291115057151

Number of decimal digits in the 27th Mersenne prime:

length(char(longint(2)^44497-1))
  13395