Closed Bug 338005 Opened 19 years ago Closed 18 years ago

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

Categories

(Core Graveyard :: Web Services, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sspeiche, Assigned: sspeiche)

References

()

Details

(Keywords: fixed1.8.0.8, fixed1.8.1.1)

Attachments

(2 files)

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
Attached file test case w/ inline schema (deleted) —
enter values in form to see validity results
Attached patch patch (deleted) — Splinter Review
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)
Attachment #222856 - Flags: review?(doronr) → review+
Assignee: aaronr → sspeiche
Status: UNCONFIRMED → NEW
Ever confirmed: true
checked into trunk for sspeiche
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: xf-to-branch
Component: XForms → Web Services
OS: Windows XP → All
Hardware: PC → All
checked into 1.8.0 branch on 2006/09/21
Keywords: fixed1.8.0.8
checked into 1.8 branch on 2006/11/21
Keywords: fixed1.8.1.1
Whiteboard: xf-to-branch
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: