Hi everyone! I'm playing a bit with the new compiler and I can't figure out how to call math functions. Does the Num module still exists ?
No it doesn't --- src/build/roc/Builtin.roc defines all the builtin functions
$ roc repl
Roc REPL
Type :help for help, :exit to quit
» U16.plus(12,32)
44
» 12 + 23
35
» U32.div_by(12,3)
4
Cool, it works. Thanks !
It's a bit funky... but you can do
» 12.U64.plus(12)
24
» 12.plus(12)
24
I’ll give it a try, thanks! I think I’ll try to implement a few more complex functions (cos, sin, exp, …) in pure roc since I don’t see them in the built in file, just for fun. Is it going to be added in the futur ?
I just made #9231 to make sure we add them :)
Last updated: Mar 20 2026 at 12:28 UTC