• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

blockfirm / pine-app / 474
47%

Build:
DEFAULT BRANCH: master
Ran 30 May 2019 10:49PM UTC
Jobs 1
Files 480
Run time 25s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
474

push

travis-ci

timothyej
Normalize BTC amounts when doing floating-point arithmetic

JavaScript sometimes lose precision when performing floating-point arithmetic.
The precision loss is insignificant to BTC amounts which has a precision of 8
decimals, but it is a problem when comparing numbers, e.g. 0.7 + 0.1 < 0.8 => true.
It could also become a rounding error when summing up large amounts of values.

To prevent this, always normalize BTC amounts to have a precision of 8 decimals
after a new BTC amount has been produced by floating-point arithmetic.
If the amount has more than 8 decimals, the 8th decimal will be rounded. Since
the precision loss is so low, any errors will be rounded to the desired number.

803 of 1974 branches covered (40.68%)

Branch coverage included in aggregate %.

3798 of 6367 relevant lines covered (59.65%)

6.94 hits per line

Jobs
ID Job ID Ran Files Coverage
1 474.1 30 May 2019 10:49PM UTC 0
55.16
Travis Job 474.1
Source Files on build 474
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #474
  • 15f6de92 on github
  • Prev Build on master (#473)
  • Next Build on master (#475)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc