Usage of INF/-INF with float and double not as expected

RESOLVED FIXED

Status

()

Core
Web Services
--
minor
RESOLVED FIXED
11 years ago
10 years ago

People

(Reporter: Steve Speicher, Assigned: Steve Speicher)

Tracking

({fixed1.8.0.8, fixed1.8.1.1})

Trunk
fixed1.8.0.8, fixed1.8.1.1
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(2 attachments)

2.45 KB, application/xhtml+xml
Details
13.51 KB, patch
Doron Rosenberg (IBM)
: review+
Details | Diff | Splinter Review
(Assignee)

Description

11 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3

When values are typed as float or double, have the "special values" of INF and -INF.  When simple types are bound to facets of INF/-INF the values do not behave as expected.

Problem appears to be around the fact that strtod (and ToFloat()) don't return the appropriate values for INF and -INF.  strtod usually
returns 0.0 for both INF and -INF. ToFloat() usually returns garbage for INF
and -INF.

X-Smiles uses the Xerces validator, which handles these properly ie -INF < INF,
-INF < everything, everything < INF, ... what you'd expect.

Perhaps this should be handled directly in strtod and ToFloat()? or just indirectly our processing of infinity.

See related bug 331897

Reproducible: Always
(Assignee)

Comment 1

11 years ago
Created attachment 222055 [details]
test case w/ inline schema

enter values in form to see validity results
(Assignee)

Comment 2

11 years ago
Created attachment 222856 [details] [diff] [review]
patch

since it was fresh on my mind, handling in schema validation code makes more sense as handling of NaN is special to xml schema.  Though would *be nice* if moz utils could return appropriate values for +/-INF.
Attachment #222856 - Flags: review?(doronr)

Updated

11 years ago
Attachment #222856 - Flags: review?(doronr) → review+

Updated

11 years ago
Assignee: aaronr → sspeiche
Status: UNCONFIRMED → NEW
Ever confirmed: true

Comment 3

11 years ago
checked into trunk for sspeiche
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
Whiteboard: xf-to-branch

Updated

11 years ago
Component: XForms → Web Services
OS: Windows XP → All
Hardware: PC → All

Comment 4

11 years ago
checked into 1.8.0 branch on 2006/09/21
Keywords: fixed1.8.0.8

Comment 5

10 years ago
checked into 1.8 branch on 2006/11/21
Keywords: fixed1.8.1.1
Whiteboard: xf-to-branch
You need to log in before you can comment on or make changes to this bug.