mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
Fix Num.sqrt, div, mod, and rem
This commit is contained in:
parent
ee52d52047
commit
44477f98e9
6 changed files with 118 additions and 42 deletions
|
@ -1366,7 +1366,7 @@ fn run_low_level<'a, 'ctx, 'env>(
|
|||
"cast_collection",
|
||||
)
|
||||
}
|
||||
NumAbs | NumNeg | NumRound | NumSqrt | NumSin | NumCos | NumToFloat => {
|
||||
NumAbs | NumNeg | NumRound | NumSqrtUnchecked | NumSin | NumCos | NumToFloat => {
|
||||
debug_assert_eq!(args.len(), 1);
|
||||
|
||||
let arg = build_expr(env, layout_ids, scope, parent, &args[0].0);
|
||||
|
@ -1683,7 +1683,7 @@ fn build_float_unary_op<'a, 'ctx, 'env>(
|
|||
match op {
|
||||
NumNeg => bd.build_float_neg(arg, "negate_float").into(),
|
||||
NumAbs => call_intrinsic(LLVM_FABS_F64, env, &[(arg.into(), arg_layout)]),
|
||||
NumSqrt => call_intrinsic(LLVM_SQRT_F64, env, &[(arg.into(), arg_layout)]),
|
||||
NumSqrtUnchecked => call_intrinsic(LLVM_SQRT_F64, env, &[(arg.into(), arg_layout)]),
|
||||
NumRound => call_intrinsic(LLVM_LROUND_I64_F64, env, &[(arg.into(), arg_layout)]),
|
||||
NumSin => call_intrinsic(LLVM_SIN_F64, env, &[(arg.into(), arg_layout)]),
|
||||
NumCos => call_intrinsic(LLVM_COS_F64, env, &[(arg.into(), arg_layout)]),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue