Code Monkey home page Code Monkey logo

Comments (4)

3sGgpQ8H avatar 3sGgpQ8H commented on June 4, 2024 2

Both, argument and result are 64.64-bit fixed point numbers, so 1 means 1*2^-64, and 18446744073709551616 means 18446744073709551616*2^-64. This number format is used for almost all functions within ABDKMath64x64 library. Where different number format is used, it is stated in docstring.

from abdk-libraries-solidity.

PaulRBerg avatar PaulRBerg commented on June 4, 2024 2

Hey @bgits, you may find useful this number converter developed by @3sGgpQ8H:

https://toolkit.abdk.consulting/math#convert-number

from abdk-libraries-solidity.

3sGgpQ8H avatar 3sGgpQ8H commented on June 4, 2024

What arguments did you try? Due to rounding errors, exp(x) may return the same value for different arguments in case argument values are close enough.
In my experiments exp(1)=18446744073709551616 but exp(2)=18446744073709551617, so different results for different arguments.

from abdk-libraries-solidity.

bgits avatar bgits commented on June 4, 2024

Perhaps I'm misunderstanding the function, my understanding is that is should return e^x, in which case exp(1) = 2..., exp(2) = 7....

If the intention is as above then the calculation is off, otherwise perhaps a clarification on the function docstring.

from abdk-libraries-solidity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.