Stream: compiler development

Topic: Num.isApproxEq


view this post on Zulip Aurélien Geron (Aug 26 2024 at 05:58):

I'm getting this error with Num.isApproxEq:

» Num.isApproxEq 0.5 0.5 {}
thread 'main' panicked at crates/compiler/gen_dev/src/generic64/mod.rs:1333:18:
not yet implemented: NumAbs: layout, Builtin(Decimal)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Is it really not implemented or am I using it wrong?

view this post on Zulip Aurélien Geron (Aug 26 2024 at 05:59):

Oh it looks like it works with F64:

» Num.isApproxEq 0.5f64 0.5f64 {}

Bool.true : Bool

So I guess it's just an issue with Dec?

view this post on Zulip Luke Boswell (Aug 26 2024 at 06:00):

Yeah, must not be implemented for Dec in the gen_dev backend

view this post on Zulip Aurélien Geron (Aug 26 2024 at 06:01):

Sounds good, thanks

view this post on Zulip Luke Boswell (Aug 26 2024 at 06:02):

Tracking issue https://github.com/roc-lang/roc/issues/3513


Last updated: Jul 06 2025 at 12:14 UTC