solidity-fixedpoint

1.0.1 • Public • Published

Solidity Fixed Point Library

Actions Status npm

Implements fixed point numbers in Solidity using the Q number format.

Built off the Uniswap FixedPoint and Babylonian libraries developed by moodysalem.

This library uses the UQ192x64 format to maximize the range of fixed point numbers while keeping the resolution close to the 18 decimal places that is standard for most Solidity contracts.

Uniswap originally used the UQ112x112 format to optimize the variable packing in their contracts.

Install Dependencies

npm install

Compile Contracts

npx buidler compile

Run Tests

npx buidler test

Contributors

Package Sidebar

Install

npm i solidity-fixedpoint

Weekly Downloads

2

Version

1.0.1

License

GPL-3.0-or-later

Unpacked Size

45.1 kB

Total Files

7

Last publish

Collaborators

  • opz