remove f64 maths from stdlib
This commit is contained in:
parent
1de2322110
commit
3868298f00
3 changed files with 8 additions and 116 deletions
|
@ -1,6 +1,7 @@
|
|||
use core::cell::RefCell;
|
||||
|
||||
use alloc::{boxed::Box, format, rc::Rc, string::String, vec::Vec};
|
||||
use libm::floor;
|
||||
|
||||
use crate::{util::Boxable, Context, EvalError, FunImpl, Function, Value};
|
||||
use chumsky::{
|
||||
|
@ -311,7 +312,7 @@ impl Expr {
|
|||
match (value, index) {
|
||||
(Value::Array(v), Value::Num(n)) => Ok(v
|
||||
.borrow()
|
||||
.get(n.floor().max(0.) as usize)
|
||||
.get(floor(n).max(0.) as usize)
|
||||
.cloned()
|
||||
.unwrap_or(Value::None)),
|
||||
(Value::Object(m), Value::Str(s)) => Ok(m.borrow().get(&s).cloned().unwrap_or(Value::None)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue