« Bugzilla Issues Index
#2580 — Why does Math.hypot(Infinity,NaN) return Infinity?
- bug_id:
2580
- creation_ts:
2014-03-17 13:43:00 -0700
- short_desc:
Why does Math.hypot(Infinity,NaN) return Infinity?
- delta_ts:
2014-04-05 10:20:23 -0700
- product:
Draft for 6th Edition
- component:
technical issue
- version:
Rev 22: January 20, 2014 Draft
- rep_platform:
All
- op_sys:
All
- bug_status:
RESOLVED
- resolution:
WONTFIX
- priority:
Normal
- bug_severity:
normal
- everconfirmed:
true
- reporter:
Allen Wirfs-Brock
- assigned_to:
Allen Wirfs-Brock
- cc:
["brendan", "lukeh", "oliver"]
- commentid:
7436
- comment_count:
0
- who:
Allen Wirfs-Brock
- bug_when:
2014-03-17 13:43:52 -0700
https://bugs.webkit.org/show_bug.cgi?id=129486 asks why the Math.hypot spec. says:
If any argument is +Infinity, the result is +Infinity.
If any argument is -Infinity, the result is +Infinity.
If no argument is +Infinity or -Infinity, and any argument is NaN, the result is NaN.
this seems to be what C libraries do:
http://pubs.opengroup.org/onlinepubs/009696799/functions/hypot.html
http://man7.org/linux/man-pages/man3/hypot.3.html
and is (according to Wikipedia) what the IEEE spec requires:
http://en.wikipedia.org/wiki/NaN#Function_definition