the.bay.news

Proposal: Better lossy casting for int-to-float

Ziggit
Proposal: Better lossy casting for int-to-float
I’m creating a window/graphics library in Zig, and during this process I’ve hit some more headaches with the casting syntax. This stems from the changes with implicit int-to-float conversions (small enough integer can implicitly convert to a float) as well as using @trunc, @floor, @ceil, @round in place of @intFromFloat. These changes are great, as they drastically improve ergonomics and more importantly, code readability. However, a common pattern I’m running into is around float arithmetic i...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.