question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

long number rounding error

See original GitHub issue

Hello, i initialize slider with data

var settings = {
  connect: "lower",
  range: {
    max: 87654567890,
    min: 0
  },
  start: 30679098762,
  step: 1
}

after initialization slider value is 30679098761.50 why? Demo here - https://jsfiddle.net/serGlazkov/yrppsmvo/5/

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
leongersencommented, Apr 16, 2016

I’ve made some changes to the way decimals are handled, which resolves this issue. Thanks for the test case!

1reaction
serGlazkovcommented, Feb 25, 2016

On initialization i set a integer value and why slider change it? I know what slider change value, because translate value to percent and back, and it not bad, but not on initialization. And more, i can’t set value, plugin change it. Demo here https://jsfiddle.net/serGlazkov/yrppsmvo/8/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rounding Error
Rounding (roundoff) error is a phenomenon of digital computing resulting from the computer's inability to represent some numbers exactly.
Read more >
Rounding Errors - The Floating-Point Guide
Rounding Errors. Because floating-point numbers have a limited number of digits, they cannot represent all real numbers accurately: when there are more ...
Read more >
Round-off error - Wikipedia
A roundoff error, also called rounding error, is the difference between the result produced by a given algorithm using exact arithmetic and the...
Read more >
Rounding Error Definition - Investopedia
A rounding error is a mathematical miscalculation caused by altering a number to an integer or one with fewer decimals.
Read more >
What is rounding error? | Definition from TechTarget
Rounding error is the difference between a rounded-off numerical value and the actual value. A rounded quantity is represented by a numeral with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found