Side navigation
#15100 closed bug (fixed)
Opened May 19, 2014 07:08AM UTC
Closed June 07, 2014 06:35PM UTC
isNumeric implementation of version 2.1.0 returns wrong results in Opera 12.17
| Reported by: | PachaG | Owned by: | gibson042 |
|---|---|---|---|
| Priority: | high | Milestone: | 1.12/2.2 |
| Component: | core | Version: | 2.1.0 |
| Keywords: | Cc: | ||
| Blocked by: | Blocking: |
Description
The isNumeric function of older (2.0.3) versions works correctly in Opera 12.17
$.isNumeric(1.5999999999999999) == false $.isNumeric(1.59999) == true
The test page
Attachments (0)
Change History (3)
Changed May 19, 2014 01:55PM UTC by comment:1
| component: | unfiled → core |
|---|---|
| milestone: | None → 1.12/2.2 |
| priority: | undecided → high |
| status: | new → open |
Changed May 19, 2014 04:10PM UTC by comment:2
| owner: | → gibson042 |
|---|---|
| status: | open → assigned |
Looks like it's from loss of precision in a string cast for parseFloat... the fix will be almost certainly be replacing obj - parseFloat( obj ) >= 0 with !isNaN( obj - parseFloat( obj ) ).
Probably this commit: https://github.com/jquery/jquery/commit/68213f20bb5d5426f99bafde028ecab601a9d105
My guess is that since we're dealing with floating point the result ends up being ever-so-slightly negative. I just need to find an Opera 12.17 to prove it.
@gibson042 what do you think?