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