Multiply two big rationals.
Prototype
int BigRat.mul( brat1 , brat2 , brat3 )
Parameters
brat1 and brat2
Numbers to be multiplied.
brat3
Returns the multiplication 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.mul( a , b , result )
print( a .. " * " .. b .. " = " .. result )
a = BigRat.new( "-543" )
b = BigRat.new( "1256" )
BigRat.mul( a , b , result )
print( a .. " * " .. b .. " = " .. result )
--Try to add non valid parameters
ret = BigRat.mul( a , d , result )
print( ret ) ;
Output
639 * 563 = 359757
-543 * 1256 = 682008
0