| Previous | Next
Math::BigRatAllows you to use arbitrarily big rationals. Math::BigRat is shipped with the Perl 5.8 source kit. For example:
Math::BigRat implements the following methods.
new(value) Creates a new Math::BigRat object. You can use all types of input for
denominator() Returns a copy of the denominator as a positive BigInt:
numerator() Returns a copy of the numerator as a signed BigInt:
parts() Returns a list consisting of a signed numerator and unsigned denominator. Both are BigInts. my($n, $d) = $rat->parts(); ### Ewwww, rat parts! print "numerator: $n\n"; print "denominator: $d\n"; |