Subtract two Big Numbers.
Prototype
int BigNum.sub( bnum1 , bnum2 , bnum3 )
Parameters
bnum1 and bnum2
Numbers to be subtracted.
bnum3
Returns the subtraction of bnum1 and bnum2.
Remarks
bnum1, bnum2, bnum3 must be created before function call.
Example
require( "BigNum.lua" )
a = BigNum.new( "639" )
b = BigNum.new( "563" )
result = BigNum.new( )
BigNum.sub( a , b , result )
print( a .. " - " .. b .. " = " .. result )
a = BigNum.new( "-543" )
b = BigNum.new( "1256" )
BigNum.sub( a , b , result )
print( a .. " - " .. b .. " = " .. result )
--Try to add non valid parameters
ret = BigNum.sub( a , d , result )
print( ret )
Output
639 - 563 = 76
-543 - 1256 = -1799
0