[ODFPlugtest] test case: "n-root on a negative radicand"

robert_weir at us.ibm.com robert_weir at us.ibm.com
Thu Oct 18 21:32:26 CEST 2012


I noticed this new test case on the wiki:   
http://plugfest.opendocsociety.org/doku.php?id=scenarios:20121018:nroot_on_negative_radicand

Was there a question on the required behavior here?

The test case in the attaches spreadsheet are all in the form:

(-8)*(1/N) where N is an odd integer: 1, 3, 5, 7

OpenFormula defines the exponentiation operator ("^") in terms of the 
POWER() function.  And the POWER() function is defined in section 6.16.46. 
 For these inputs the spec says:

"POWER(a,b), where a<=0 and INT(b)!=b, is implementation-defined."

My opinion:  now we might think that (-8)^(1/3) is clearly -2.  But in the 
world of floating point math, 1/3 does not have an exact representation. 
That leads to some weirdness.  For example, Excel 2010 says that 
(-8)^(1/3) == -2.  But (-8)^(1/3 + 0.000001) == #NUM.    This is one 
reason we specified this as implementation-defined.  We didn't want to put 
a requirement on spreadsheet numeric precision or to rely on an 
implementation's ability to distinguish the reciprocal of an integer from 
any other random floating point number.

Regards,

-Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://open.nlnet.nl/pipermail/plugtest/attachments/20121018/11bf2ba9/attachment.html>


More information about the Plugtest mailing list