* Synced the perlfaq
[p5sagit/p5-mst-13.2.git] / lib / bigrat.pl
index 5bd127a..f5378b8 100644 (file)
@@ -1,8 +1,20 @@
 package bigrat;
 require "bigint.pl";
-
-# Arbitrary size rational math package
 #
+# This library is no longer being maintained, and is included for backward
+# compatibility with Perl 4 programs which may require it.
+# This legacy library is deprecated and will be removed in a future
+# release of perl.
+#
+# In particular, this should not be used as an example of modern Perl
+# programming techniques.
+#
+# Arbitrary size rational math package
+
+warn( "The 'bigrat.pl' legacy library is deprecated and will be"
+      . " removed in the next major release of perl. Please use the"
+      . " bigrat module instead." );
+
 # by Mark Biggar
 #
 # Input values to these routines consist of strings of the form 
@@ -55,6 +67,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);