diff options
Diffstat (limited to 'src/stdlib')
| -rw-r--r-- | src/stdlib/reals.c | 2 | ||||
| -rw-r--r-- | src/stdlib/reals.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/stdlib/reals.c b/src/stdlib/reals.c index 40f4cf4c..aee39414 100644 --- a/src/stdlib/reals.c +++ b/src/stdlib/reals.c @@ -240,7 +240,7 @@ Real_t Real$divided_by(Real_t x, Real_t y) { } static Int_t Real$compute_sqrt(Real_t r, int64_t decimals) { - Real_t operand = &r->userdata.children[0]; + Real_t operand = r->userdata.children; double d = Real$as_float64(operand); // TODO: newton's method to iterate return Int$from_float64(sqrt(d) * pow(10.0, (double)decimals), true); diff --git a/src/stdlib/reals.h b/src/stdlib/reals.h index 1d304aa5..8750fdbb 100644 --- a/src/stdlib/reals.h +++ b/src/stdlib/reals.h @@ -18,7 +18,7 @@ double Real$as_float64(Real_t x); Int_t Real$as_int(Real_t x); Real_t Real$negative(Real_t x); -// Real_t Real$inverse(Real_t x); +Real_t Real$sqrt(Real_t x); Real_t Real$plus(Real_t x, Real_t y); Real_t Real$minus(Real_t x, Real_t y); Real_t Real$times(Real_t x, Real_t y); |
