This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Merge gv_AVadd(), gv_HVadd() and gv_SVadd() into gv_add_by_type().
[perl5.git] / lib / bigrat.pl
index 5bd127a..2d3738f 100644 (file)
@@ -1,6 +1,12 @@
 package bigrat;
 require "bigint.pl";
-
+#
+# This library is no longer being maintained, and is included for backward
+# compatibility with Perl 4 programs which may require it.
+#
+# In particular, this should not be used as an example of modern Perl
+# programming techniques.
+#
 # Arbitrary size rational math package
 #
 # by Mark Biggar
@@ -55,6 +61,7 @@ sub norm { #(bint, bint) return rat_num
        'NaN';
     } else {
        local($gcd) = &'bgcd($num,$dom);
+       $gcd =~ s/^-/+/;
        if ($gcd ne '+1') { 
            $num = &'bdiv($num,$gcd);
            $dom = &'bdiv($dom,$gcd);