Stream: beginners

Topic: Num.sqrt


view this post on Zulip Uberto Barbini (Jan 05 2024 at 07:43):

Is it broken or am I missing something?

it always gives me a panic:

../roc_nightly-linux_x86_64-2024-01-03-b1f7316/roc repl
Enter an expression, or :help, or :q to quit.

» Num.sqrt 4.0
thread 'main' panicked at 'internal error: entered unreachable code: invalid layout for sqrt', crates/compiler/gen_dev/src/lib.rs:1391:26

view this post on Zulip Luke Boswell (Jan 05 2024 at 07:54):

Most likely broken, may be not yet implemented for that architecture. Might be worth logging an issue for it, if there isn't one.

view this post on Zulip Uberto Barbini (Jan 05 2024 at 08:08):

it seems the same for Num.pow (and maybe others). I'm happy to fix them if it's just a trivial issue with my arch (linux_x86_64). but I need a nudge in the right direction.

view this post on Zulip Alexander Pyattaev (Jan 05 2024 at 09:04):

Yep, it definitely crashes on x86_64 with the same message for sqrt. However, the error for Num.pow is different: 'not yet implemented: low level, NumPow'

view this post on Zulip Uberto Barbini (Jan 05 2024 at 09:36):

Reading https://github.com/roc-lang/roc/issues/6208 the issue is not so trivial. There is a workaround tho, just cast to f64


Last updated: Jul 06 2025 at 12:14 UTC