aboutsummaryrefslogtreecommitdiffstats
path: root/tables/square_root.py
diff options
context:
space:
mode:
Diffstat (limited to 'tables/square_root.py')
-rwxr-xr-xtables/square_root.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tables/square_root.py b/tables/square_root.py
new file mode 100755
index 0000000..67ab9f7
--- /dev/null
+++ b/tables/square_root.py
@@ -0,0 +1,16 @@
+#! /usr/bin/python3
+
+from math import sqrt
+
+table_size = 65536
+line_spacing = 20
+
+print("float sldjSqrtTable[%d] = {" % table_size)
+
+for c in range(table_size):
+ print(f"{sqrt(c)},", end="")
+
+ if c % line_spacing == 0:
+ print()
+
+print("};")