Skip to content

Instantly share code, notes, and snippets.

@mlschroe
Created August 26, 2011 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlschroe/1173109 to your computer and use it in GitHub Desktop.
Save mlschroe/1173109 to your computer and use it in GitHub Desktop.
--- src/core/Num.pm.orig 2011-08-25 18:24:42.000000000 +0000
+++ src/core/Num.pm 2011-08-26 09:37:08.000000000 +0000
@@ -30,6 +30,7 @@ my class Num {
while $r != 0 && abs($num - ($b/$d)) > $epsilon {
($r, $q) = modf(1/$r);
+ die("Provided Num does not fit into a Rat\n") if $a < 0 || $b < 0;
($a, $b) = ($b, $q*$b + $a);
($c, $d) = ($d, $q*$d + $c);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment