david135 / ypsilon

Automatically exported from code.google.com/p/ypsilon
Other
0 stars 0 forks source link

value of min and max depends on order of arguments when nan is an argument #108

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. (min +nan.0 0.0) -> 0.0
2. (min 0.0 +nan.0) -> +nan.0

What is the expected output? What do you see instead?
I expect them to return the same result.  Which one depends on your choice
of standard or interpretation.

What version of the product are you using? On what operating system?
Ypsilon 0.9.6-update3 on Ubuntu 9.04 (i386).

Please provide any additional information below.

Original issue reported on code.google.com by Li.Any...@gmail.com on 15 Jul 2009 at 4:56

GoogleCodeExporter commented 9 years ago
I don't think this is a bug.  +nan.0 is neither greater than nor less than 0.0.

Original comment by aghul...@gmail.com on 17 Jul 2009 at 11:17

GoogleCodeExporter commented 9 years ago
Thank you for your messages.

> I don't think this is a bug.  +nan.0 is neither greater than nor less than 
0.0.

I agree. I think both results of (min +nan.0 0.0) and (min 0.0 +nan.0) are 
unspecified.

> I expect them to return the same result.  Which one depends on your choice
of standard or interpretation.

It is possible to implement them returns same results, but it require extra 
costs for
every call in most cases. So, I prefer to keep current implementation.

Your comments are very welcome. :)

-- fujtia

Original comment by y.fujita...@gmail.com on 19 Jul 2009 at 2:13