-
I have been trying to make a constant fixed point number, but cannot figure out how. The closest I have come is just making a constant float, which is not ideal since the gba doesnt have hardware support for floats. How do I make a const fixed point? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I don't think you can do it right now since there are is no way to declare a method on a trait as const :(. Once that's stabilised, we can add the ability to do this. Although if you check the resulting code you suggested above and what it gets compiled to, I would assume that it compiles to a constant anyway? I'm quite trusting of the inliner (maybe too much 😄). If not, could you file a separate issue with agb since we rely on that fact in the library itself 😉. |
Beta Was this translation helpful? Give feedback.
I don't think you can do it right now since there are is no way to declare a method on a trait as const :(. Once that's stabilised, we can add the ability to do this.
Although if you check the resulting code you suggested above and what it gets compiled to, I would assume that it compiles to a constant anyway? I'm quite trusting of the inliner (maybe too much 😄). If not, could you file a separate issue with agb since we rely on that fact in the library itself 😉.