BigInteger in pascal

Write here if you have problems with your Pascal source code

Moderator: Board moderators

Post Reply
randomtaiwanese
New poster
Posts: 32
Joined: Fri Oct 01, 2004 10:53 pm

BigInteger in pascal

Post by randomtaiwanese » Mon Nov 15, 2004 9:43 pm

is there such thing, or i have to write such thing myself?

*luna*
New poster
Posts: 6
Joined: Tue Jan 11, 2005 9:12 pm
Location: Slovenia
Contact:

Post by *luna* » Tue Jan 11, 2005 11:01 pm

i think you mean longinteger (longint)?

integer (-32768..32767)
longint (-2147483648..2147483647)

User avatar
neowarez
New poster
Posts: 14
Joined: Tue May 06, 2003 11:04 pm
Location: Portugal
Contact:

Post by neowarez » Wed Jan 12, 2005 2:23 am

well..

For integers up to 2^64 you can use long long on C or Int64 on Pascal.. but if the numbers are much more larger you need to write it..
Neo

User avatar
_.B._
Experienced poster
Posts: 160
Joined: Sat Feb 07, 2004 7:50 pm
Location: Venezuela
Contact:

To write, or not to write.

Post by _.B._ » Wed Jan 12, 2005 6:03 am

Greetings!
For a 32-bit compiler like FreePascal, the big integer types and ranges are:

Code: Select all

Predefined integer types 

Type  Range  Size in bytes 
Byte  0 .. 255  1 
Shortint  -128 .. 127  1 
Smallint  -32768 .. 32767  2 
Word  0 .. 65535  2 
Integer  either smallint, longint or int64  size 2,4 or 8 
Cardinal  either word, longword or qword  size 2,4 or 8 
Longint  -2147483648 .. 2147483647  4 
Longword 0..4294967295  4 
Int64  -9223372036854775808 .. 9223372036854775807 8 
QWord  0 .. 18446744073709551615  8 
Check Free Pascal - Ordinal Types

If you need anything larger than that, you'll have to code it yourself 8)
IF you know an easy way, code it.

Keep posting!
_.

Post Reply

Return to “Pascal”