-
-
Save synthmeat/635fdda6ff7dd52fedbf7e9b3ce81dd6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env perl6 | |
my $n = FatRat.new: 0, 1; | |
my $sum = FatRat.new: 0, 1; | |
loop { | |
$sum += 1 / 2**$n++; | |
put $sum.^name; | |
put .numerator, '/', .denominator given $sum; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment