Bug 49782 - 255 stepUp()s for step=0.00392156863 is not 1.
Summary: 255 stepUp()s for step=0.00392156863 is not 1.
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-18 19:56 PST by Dai Mikurube
Modified: 2011-05-31 21:12 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dai Mikurube 2010-11-18 19:56:09 PST
How to reproduce:
1. <input type="number" min="0" value="0" step="0.00392156863" />
2. stepUp() for 255 times.

Expected:
1 (from an example at HTML5 spec. : 4.10.7.2.11 The step attribute)

Actual:
1.00000000065


Discussed at the bug 48976.

Hints:
I found we can calculate it if completely using IEEE 754 single precision numbers.
Re-considering precisions in calculation and printing may help.

Another option:
Re-consider the spec.