Skip to content

Commit

Permalink
floats working for basic arithmetic
Browse files Browse the repository at this point in the history
  • Loading branch information
billhails committed Apr 10, 2024
1 parent 4f705d9 commit 10c6cb9
Show file tree
Hide file tree
Showing 11 changed files with 701 additions and 115 deletions.
75 changes: 74 additions & 1 deletion fn/irrational.fn
Original file line number Diff line number Diff line change
@@ -1 +1,74 @@
print(1.5)
// int bigint rational irrational
// left right
// + - * / % ** cmp
let
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));
Loading

0 comments on commit 10c6cb9

Please sign in to comment.