summaryrefslogtreecommitdiff
path: root/double.c
diff options
context:
space:
mode:
authorJulian Weigt <juw@posteo.de>2025-12-28 15:40:34 +0000
committerJulian Weigt <juw@posteo.de>2026-02-04 15:55:49 +0100
commit3cff2acc8eec95183fe4cd3dcc3a3bf30b37ce66 (patch)
treed2f3627b2d6c1a0a65c3713ab9bb687ea2c1d1b0 /double.c
parent634f01454f1c0f1a33adc50b5f584e39748ff832 (diff)
Add root_to_string function to enable printing of roots.
Diffstat (limited to 'double.c')
-rw-r--r--double.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/double.c b/double.c
index cf4796c..f86a586 100644
--- a/double.c
+++ b/double.c
@@ -31,3 +31,8 @@ bool to_string(char* s, double d){
sprintf(s,"%f",d);
return true;
}
+
+bool root_to_string(char* s, double d, double p){
+ to_string(s,pow(d,1/p));
+ return true;
+}