Skip to content

Commit

Permalink
Merge pull request #57 from billhails/irrationals
Browse files Browse the repository at this point in the history
Irrationals
  • Loading branch information
billhails authored Apr 10, 2024
2 parents 9e0e1d9 + 30f0fab commit 8262f0f
Show file tree
Hide file tree
Showing 13 changed files with 1,016 additions and 303 deletions.
80 changes: 79 additions & 1 deletion fn/irrational.fn
Original file line number Diff line number Diff line change
@@ -1 +1,79 @@
print(1.5)
// int bigint rational irrational
// left right
// + - * / % ** cmp
let
fn test {
(1.0) { 0.0 }
(n) { 1 + n }
}
bi = 642086031413279956691053384794363;
in
print(1 + 1);
print(1 + bi);
print(1 + 1/2);
print(1 + 0.5);

print(bi + 1);
print(bi + bi);
print(bi + 1/2);
print(bi + 0.5);

print(1/2 + 1);
print(1/2 + bi);
print(1/2 + 1/2);
print(1/2 + 0.5);

print(0.5 + 1);
print(0.5 + bi);
print(0.5 + 1/2);
print(0.5 + 0.5);
print(1 * 1);
print(1 * bi);
print(1 * 1/2);
print(1 * 0.5);
print(bi * 1);
print(bi * bi);
print(bi * 1/2);
print(bi * 0.5);
print(1/2 * 1);
print(1/2 * bi);
print(1/2 * 1/2);
print(1/2 * 0.5);
print(0.5 * 1);
print(0.5 * bi);
print(0.5 * 1/2);
print(0.5 * 0.5);
print(1 / 1);
print(1 / bi);
print(1 / (1/2));
print(1 / 0.5);
print(bi / 1);
print(bi / bi);
print(bi / (1/2));
print(bi / 0.5);
print((1/2) / 1);
print((1/2) / bi);
print((1/2) / (1/2));
print((1/2) / 0.5);
print(0.5 / 1);
print(0.5 / bi);
print(0.5 / (1/2));
print(0.5 / 0.5);
print(1 ** 1);
// print(1 ** bi);
print(1 ** (1/2));
print(1 ** 0.5);
print(bi ** 1);
// print(bi ** bi);
print(bi ** (1/2));
print(bi ** 0.5);
print((1/2) ** 1);
// print((1/2) ** bi);
print((1/2) ** (1/2));
print((1/2) ** 0.5);
print(0.5 ** 1);
print(0.5 ** bi);
print(0.5 ** (1/2));
print(0.5 ** 0.5);
// print(sin(0.5));
print(test(12));
Loading

0 comments on commit 8262f0f

Please sign in to comment.