summaryrefslogtreecommitdiff
path: root/problem99.ijs
diff options
context:
space:
mode:
Diffstat (limited to 'problem99.ijs')
-rw-r--r--problem99.ijs9
1 files changed, 9 insertions, 0 deletions
diff --git a/problem99.ijs b/problem99.ijs
new file mode 100644
index 0000000..0c7de2a
--- /dev/null
+++ b/problem99.ijs
@@ -0,0 +1,9 @@
+NB. The trick is to convert numbers to a common base using
+NB. a^b = e^(b * ln(a)), so by comparing the exponents we
+NB. avoid calculating the large number
+
+solve =: {{
+ >:{.\:{{y*^.x}}/|:1000 2$".>{.|:2000 2$;:fread y
+}}
+
+problem99 =: solve 'p099_base_exp.txt'