summaryrefslogtreecommitdiff
path: root/ratio.h
diff options
context:
space:
mode:
authorJulian Weigt <juw@posteo.de>2026-01-16 13:41:52 +0100
committerJulian Weigt <juw@posteo.de>2026-02-04 15:55:53 +0100
commit8145ba753df183f0d48cd6e9cc5a01b215eb31dc (patch)
tree6ab91cd3774bb42d55c196db26387f67bf082da3 /ratio.h
parent5c0dc646b78e2d7ef25088ac78397e2ed613cba1 (diff)
Properly use header files and change return type for conversion from bool to int.
Diffstat (limited to 'ratio.h')
-rw-r--r--ratio.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/ratio.h b/ratio.h
index ff4015e..e273f7f 100644
--- a/ratio.h
+++ b/ratio.h
@@ -1,3 +1,6 @@
+#ifndef RATIO_H
+#define RATIO_H
+
#include <stdbool.h>
typedef struct {bool s; unsigned long long n; unsigned long long d;} rational;
@@ -27,6 +30,8 @@ rational power(rational,unsigned int);
double to_double(rational);
-bool to_string(char*,rational r);
+int to_string(char*,rational r);
+
+int root_to_string(char*,rational r,unsigned int);
-bool root_to_string(char*,rational r,unsigned int);
+#endif