diff options
| author | Julian Weigt <juw@posteo.de> | 2026-01-16 13:41:52 +0100 |
|---|---|---|
| committer | Julian Weigt <juw@posteo.de> | 2026-02-04 15:55:53 +0100 |
| commit | 8145ba753df183f0d48cd6e9cc5a01b215eb31dc (patch) | |
| tree | 6ab91cd3774bb42d55c196db26387f67bf082da3 /double.c | |
| parent | 5c0dc646b78e2d7ef25088ac78397e2ed613cba1 (diff) | |
Properly use header files and change return type for conversion from bool to int.
Diffstat (limited to 'double.c')
| -rw-r--r-- | double.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1,3 +1,4 @@ +#include "double.h" #include <stdlib.h> #include <math.h> #include <stdio.h> @@ -30,12 +31,12 @@ double power(double d, double p) { return pow(d,p); } double to_double(double d){ return d; } -bool to_string(char* s, double d){ +int to_string(char* s, double d){ sprintf(s,"%f",d); - return true; + return 0; } -bool root_to_string(char* s, double d, double p){ +int root_to_string(char* s, double d, double p){ to_string(s,pow(d,1/p)); - return true; + return 0; } |
