Skip to content

Instantly share code, notes, and snippets.

@mlschroe
Created August 25, 2011 18:29
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/1171388 to your computer and use it in GitHub Desktop.
Save mlschroe/1171388 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-25 18:26:47.000000000 +0000
@@ -24,8 +24,8 @@ my class Num {
my Num $r = $num - $num.Int;
my Int $q = $num.Int;
- my ($a, $b) = 1, $q;
- my ($c, $d) = 0, 1;
+ my ($a, $b) = 1e0, $q.Num;
+ my ($c, $d) = 0e0, 1e0;
while $r != 0 && abs($num - ($b/$d)) > $epsilon {
($r, $q) = modf(1/$r);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment