Skip to content

I cannot figure out how to make a const fixed point. #370

Answered by gwilymk
xokz asked this question in Q&A
Discussion options

You must be logged in to vote

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 😉.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@corwinkuiper
Comment options

Answer selected by gwilymk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants