Login
You're viewing the gulp.cafe public feed.
  • Oct 28, 2026, 7:25 PM

    @petmac Obvious troll aside, my half-serious answer is - all integers are fixed-point numbers, they just have a fraction of zero. So the actual naming scheme I would use is i16_16, and i32 is just shorthand for i32_0.

    And my actual serious answer is that in practice I put the number of fractional bits in the VARIABLE, not the TYPE. So in fact 16_16 looks like:

    i32 someValue16;

    (I did try putting it in the type and having type-safe blah blah and all magically work and in practice it's a PITA)

    💬 1🔄 0⭐ 1

Replies

  • Oct 28, 2026, 7:28 PM

    @petmac For anyone wondering why I do so much fixed-point work - it's all when doing retro 68000 code.

    In my day job I do keep talking about fixed point for world position and time, but those are nicely wrapped up in their own classes and nobody else needs to know or care about the details because they're all hidden inside the class. I'm eccentric, not insane.

    💬 0🔄 0⭐ 1