Skip to content

How to modify PRB-Math powu to support more decimal places? #113

Closed Answered by PaulRBerg
publiuss asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @publiuss, I'm glad that you find my implementation of powu function useful.

  1. Unfortunately, I first wrote PRBMath in 2021, and so I can't remember all the places where I assumed that I'm working with 18 decimals exclusively. I really don't know if changing those constants would be enough.
  2. Have you seen the NatSpec for those constants? Here they are: SCALE_LPOTD and SCALE_INVERSE.
    • In my case, SCALE_LPOTD is 262144 because that is the largest power of two that divides 1e18
    • It might also be worth it to read Remco Bloemen's article about muldiv, since that's where I sourced the constants from, in the first place.
  3. Definitely, but this should be the least of your concerns.
  4. I don't kno…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by PaulRBerg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants