diff options
| -rw-r--r-- | src/environment.c | 1 | ||||
| -rw-r--r-- | src/stdlib/reals.h | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/environment.c b/src/environment.c index baae3beb..8087820a 100644 --- a/src/environment.c +++ b/src/environment.c @@ -300,6 +300,7 @@ env_t *global_env(bool source_mapping) { {"power", "Real$power", "func(base:Real,exponent:Real -> Real)"}, // {"sqrt", "Real$sqrt", "func(x:Real -> Real)"}, // {"times", "Real$times", "func(x,y:Real -> Real)"}, // + {"rounded_to", "Real$rounded_to", "func(x:Real, rounded_to:Real = 1.0 -> Real)"}, // ), MAKE_TYPE( // "CString", Type(CStringType), Text("char*"), Text("CString$info"), // diff --git a/src/stdlib/reals.h b/src/stdlib/reals.h index a322ff64..ddb91f66 100644 --- a/src/stdlib/reals.h +++ b/src/stdlib/reals.h @@ -39,6 +39,8 @@ Real_t Real$sqrt(Real_t x); bool Real$equal(const void *va, const void *vb, const TypeInfo_t *t); int32_t Real$compare(const void *va, const void *vb, const TypeInfo_t *t); +Real_t Real$rounded_to(Real_t x, Real_t round_to); + int Real$test(); extern const TypeInfo_t Real$info; |
