High Precision Arithmetic

Quote:

>I am using some string functions to work with 96 bit integers in Turbo

>Pascal but they are so SLOW. Currently I store each 32 bits separately

>and then feed them into the string functions

>Would anyone be able to supply me either with some assembly language or

>other code that would do the job more efficiently or a contact where I

>can get such code. I need addition, subtraction, multiplication, division

>and modulo funtions particularly. Truncation and rounding functions would

>be a bonus.

Don't use strings (except as a means of getting round TP's inability to

return other than "simple" types as function results).

Store your 96 bits as array [1..6] of word, and do long arithmetic to

base 65536 in the same way as you learnt arithmetic to base 10 at school

(if you are young, ask someone who went to school before around 1960).

With {$R-} I think you'll be OK with word*word -> longint ; if not, use

array [1..12] of byte.

--

http://www.merlyn.demon.co.uk/