diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2026-01-10 13:50:16 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2026-01-10 13:50:16 -0500 |
| commit | 71806bffc5517d8928271e28d9cd1d9f519a7d25 (patch) | |
| tree | 3133bd88f2b58371ba43803aa3a8be5c6069f393 | |
| parent | 28d324d555b9fb78aebf530294ae0bd72ed350f2 (diff) | |
Format
| -rw-r--r-- | src/stdlib/reals.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/stdlib/reals.c b/src/stdlib/reals.c index 56f247ff..56cc2ecb 100644 --- a/src/stdlib/reals.c +++ b/src/stdlib/reals.c @@ -50,7 +50,9 @@ static int64_t approx_log10(Real_t r, int64_t decimals) { } } -static Int_t Real$compute_int(Real_t r, int64_t decimals) { return pow10(r->userdata.i, decimals); } +static Int_t Real$compute_int(Real_t r, int64_t decimals) { + return pow10(r->userdata.i, decimals); +} static Int_t Real$compute_double(Real_t r, int64_t decimals) { // TODO: this is probably inaccurate @@ -89,7 +91,9 @@ OptionalReal_t Real$parse(Text_t text, Text_t *remainder) { } public -Real_t Real$from_float64(double n) { return new (struct Real_s, .compute = Real$compute_double, .userdata.n = n); } +Real_t Real$from_float64(double n) { + return new (struct Real_s, .compute = Real$compute_double, .userdata.n = n); +} public double Real$as_float64(Real_t x) { @@ -117,7 +121,9 @@ static Int_t Real$compute_negative(Real_t r, int64_t decimals) { } public -Real_t Real$negative(Real_t x) { return new (struct Real_s, .compute = Real$compute_negative, .userdata.children = x); } +Real_t Real$negative(Real_t x) { + return new (struct Real_s, .compute = Real$compute_negative, .userdata.children = x); +} static Int_t Real$compute_plus(Real_t r, int64_t decimals) { Int_t lhs = Real$compute(&r->userdata.children[0], decimals + 1); @@ -223,7 +229,9 @@ static Int_t Real$compute_sqrt(Real_t r, int64_t decimals) { } public -Real_t Real$sqrt(Real_t x) { return new (struct Real_s, .compute = Real$compute_sqrt, .userdata.children = x); } +Real_t Real$sqrt(Real_t x) { + return new (struct Real_s, .compute = Real$compute_sqrt, .userdata.children = x); +} public Text_t Real$value_as_text(Real_t x, int64_t digits) { |
