logoalt Hacker News

weinzierlyesterday at 4:00 PM1 replyview on HN

sin(x) can produce different results at comptime and runtime. In Rust there is no sin(x) at comptime for precisely this reason.


Replies

chaz72yesterday at 5:18 PM

Interesting, I hadn’t run across that but that’s probably just my problem domain. I did find this bug that looks like it was resolved a year ago https://github.com/ziglang/zig/issues/24184 and I have also read they are doing some other work on floating point that will hopefully address other cross-platform inconsistencies.