Rational_reduce   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/core/rational.xtm

Implementation

(bind-func Rational_reduce
  (lambda (a:Rational)
    (let ((gcd (Rational_greatest_common_divisor (tref a 0)
                                            (tref a 1))))
      (Rat (/ (tref a 0) gcd)
           (/ (tref a 1) gcd)))))


Back to Index

Similar Entries