forked from M-Labs/nac3
core: Do not cast floor/ceil result to int
NumPy explicitly states that the return type of the floor/ceil is float.
This commit is contained in:
parent
95810d4229
commit
068f0d9faf
|
@ -762,15 +762,7 @@ pub fn get_builtins(primitives: &mut (PrimitiveStore, Unifier)) -> BuiltinInfo {
|
||||||
.try_as_basic_value()
|
.try_as_basic_value()
|
||||||
.left()
|
.left()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
Ok(Some(
|
Ok(val.into())
|
||||||
ctx.builder
|
|
||||||
.build_float_to_signed_int(
|
|
||||||
val.into_float_value(),
|
|
||||||
ctx.ctx.i32_type(),
|
|
||||||
"fptosi",
|
|
||||||
)
|
|
||||||
.into(),
|
|
||||||
))
|
|
||||||
},
|
},
|
||||||
)))),
|
)))),
|
||||||
loc: None,
|
loc: None,
|
||||||
|
@ -802,15 +794,7 @@ pub fn get_builtins(primitives: &mut (PrimitiveStore, Unifier)) -> BuiltinInfo {
|
||||||
.try_as_basic_value()
|
.try_as_basic_value()
|
||||||
.left()
|
.left()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
Ok(Some(
|
Ok(val.into())
|
||||||
ctx.builder
|
|
||||||
.build_float_to_signed_int(
|
|
||||||
val.into_float_value(),
|
|
||||||
ctx.ctx.i32_type(),
|
|
||||||
"fptosi",
|
|
||||||
)
|
|
||||||
.into(),
|
|
||||||
))
|
|
||||||
},
|
},
|
||||||
)))),
|
)))),
|
||||||
loc: None,
|
loc: None,
|
||||||
|
|
Loading…
Reference in New Issue