aboutsummaryrefslogtreecommitdiffstats
path: root/unit.c
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2025-02-28 21:01:26 -0500
committerSam Anthony <sam@samanthony.xyz>2025-02-28 21:01:26 -0500
commit942a6711361c371da0736cc62f0e3e2ed13f341b (patch)
tree607afae0b1c3446bbdc76da4b59d24ca24f0d753 /unit.c
parentfaf14d71cfbac1f21500f4b997441fa03731bf0e (diff)
downloadvolute-942a6711361c371da0736cc62f0e3e2ed13f341b.zip
fraction/percent conversion functions
Diffstat (limited to 'unit.c')
-rw-r--r--unit.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/unit.c b/unit.c
index 9e03abf..de24dc3 100644
--- a/unit.c
+++ b/unit.c
@@ -45,8 +45,16 @@ double as_rpm(AngularSpeed x) {
return x * 60.0 / (2.0 * M_PI);
}
-Fraction percent(double x);
-double as_percent(Fraction x);
+
+Fraction
+percent(double x) {
+ return x / 100.0;
+}
+
+double
+as_percent(Fraction x) {
+ return x * 100.0;
+}
Pressure