Last Comment Bug 338005 - Usage of INF/-INF with float and double not as expected
: Usage of INF/-INF with float and double not as expected
Status: RESOLVED FIXED
: fixed1.8.0.8, fixed1.8.1.1
Product: Core
Classification: Components
Component: Web Services (show other bugs)
: Trunk
: All All
: -- minor (vote)
: ---
Assigned To: Steve Speicher
: Stephen Pride
:
Mentors:
http://www.w3.org/TR/xmlschema-2/#float
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-05-15 08:48 PDT by Steve Speicher
Modified: 2007-01-11 15:57 PST (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
test case w/ inline schema (2.45 KB, application/xhtml+xml)
2006-05-15 10:26 PDT, Steve Speicher
no flags Details
patch (13.51 KB, patch)
2006-05-22 06:59 PDT, Steve Speicher
doronr: review+
Details | Diff | Splinter Review

Description Steve Speicher 2006-05-15 08:48:41 PDT
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
Comment 1 Steve Speicher 2006-05-15 10:26:30 PDT
Created attachment 222055 [details]
test case w/ inline schema

enter values in form to see validity results
Comment 2 Steve Speicher 2006-05-22 06:59:06 PDT
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.
Comment 3 aaronr 2006-05-23 23:45:50 PDT
checked into trunk for sspeiche
Comment 4 aaronr 2006-10-17 14:32:59 PDT
checked into 1.8.0 branch on 2006/09/21
Comment 5 aaronr 2007-01-11 15:57:31 PST
checked into 1.8 branch on 2006/11/21

Note You need to log in before you can comment on or make changes to this bug.