remove f64 maths from stdlib

This commit is contained in:
Matthieu Jolimaitre 2024-10-25 00:50:54 +02:00
parent 1de2322110
commit 3868298f00
3 changed files with 8 additions and 116 deletions

View file

@ -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)),