[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XPath: comparison of -0.0e0 and +0.0e0

Subject: Re: XPath: comparison of -0.0e0 and +0.0e0
From: Stefan Krause <stf@xxxxxxxx>
Date: Mon, 20 Jun 2011 00:37:25 +0200
Re:  XPath: comparison of -0.0e0 and +0.0e0
> I think its strange that the spec requires ambiguous results of atan2 for
zero-valued arguments:
>
> The expression math:atan2(+0.0e0, -0.0e0) returns 0.0e0.
> The expression math:atan2(+0.0e0, -0.0e0) returns math:pi().
>
> The expression math:atan2(-0.0e0, -0.0e0) returns -0.0e0.
> The expression math:atan2(-0.0e0, -0.0e0) returns -math:pi().

This is a bug in the spec, see
http://www.w3.org/Bugs/Public/show_bug.cgi?id=11549

Stefan


Am 20.06.2011 um 00:17 schrieb Imsieke, Gerrit, le-tex:

>
>
> On 2011-06-19 23:08, Stefan Krause wrote:
>>> [b&] Out of interest,
>>> why do you need to distinguish them?
>>
>> Because atan2(y,x) treats them different, see [1]. I try to implement this
behavior in XSLT 2.0.
>
> I think its strange that the spec requires ambiguous results of atan2 for
zero-valued arguments:
>
> The expression math:atan2(+0.0e0, -0.0e0) returns 0.0e0.
> The expression math:atan2(+0.0e0, -0.0e0) returns math:pi().
>
> The expression math:atan2(-0.0e0, -0.0e0) returns -0.0e0.
> The expression math:atan2(-0.0e0, -0.0e0) returns -math:pi().
>
> Then atan2 is no longer a function, mathematically.
>
> If, in an attempt to disambiguate the function, the B1O results were not
required, you could simply return
> -x*y for x=B10, y=B10.
>
> If the spec is flawed and should actually read:
>
> The expression math:atan2(+0.0e0, +0.0e0) returns 0.0e0.
> The expression math:atan2(+0.0e0, -0.0e0) returns -0.0e0.
> The expression math:atan2(-0.0e0, +0.0e0) returns math:pi().
> The expression math:atan2(-0.0e0, -0.0e0) returns -math:pi().
>
> then I donbt see another way than reverting to some tricks such as cast
each argument to xs:string and look up the corresponding result.
>
> Gerrit

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.