BANKEX / Solidity Float Point Calculation
Licence: mit
Proof of concept of basic math operation with Solidity
Stars: ✭ 41
Programming Languages
javascript
184084 projects - #8 most used programming language
Floating point math library
Brought to you by Bankex Foundation
WIP, not ready for production
Fuctionality
Float point number is represented in a binary256 IEEE standard (so library operates on bytes32 and uint256[3] internally).
Included functions:
- add
- sub
- mul
- div (naive implementation, slow)
- log2
- fast inverse sqrt
- fast div (using fast inverse sqrt)
Planned functions:
- exp
Known issues:
- Non-normalized numbers are not properly represented
- Overflow is not processed
What's inside
Crude core for library and set of tests, including helper functions to encode BigNumber into bytes32. Library is in a form of contract for ease of compilation in deployment (see Tester.sol for example).
How to run
npm install
npm test
tests.js is a set of helper and test functions.
Contributors
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].