<HTML><BODY>ok... I think -0.0 is mathematically wrong but in a program it is true.<br><br>What I suspect is that if -0.0 doesn't affect on result (e.g., 2*(-0.0 + 2) or (-0.0-2)*2 ) . If it does not affect results it would be good for me<br>Thanks<br><br><br>Понедельник, 20 мая 2013, 9:03 -07:00 от Chris Barker - NOAA Federal <chris.barker@noaa.gov>:<br>
<blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;" class="mailru-blockquote">
        <div id="">
        



    






        

        
        
        
        
        

        



<div class="js-helper js-readmsg-msg">
        <style type="text/css"></style>
        <div id="style_13690659020000000619" class="mr_read__body">
                <base target="_self" href="https://e.mail.ru/cgi-bin/">
                
                        <div id="style_13690659020000000619_BODY">On Mon, May 20, 2013 at 8:54 AM, Bakhtiyor Zokhidov<br>
<<a href="sentmsg?compose&To=bakhtiyor_zokhidov@mail.ru">bakhtiyor_zokhidov@mail.ru</a>> wrote:<br>
<br>
> what about the following example:<br>
>>>>new_ceil(-0.24, 0.25)<br>
> -0.0<br>
<br>
ceil rounds toward +inf (and floor towards -inf) -- this is exactly<br>
what you want if you're doing what I think you are...(note that<br>
round() rounds towards and away from zero -- so different for negative<br>
numbers...)<br>
<br>
the minus sign means "minus 0.0", which is a seemingly odd floating<br>
point thing -- but FP numbers have a sign bit, which, in this case, is<br>
set to negative, even though, mathematically speaking, 0.0 doesn't<br>
have a sign. But it will compare to 0.0 as you'd expect:<br>
<br>
In [8]: -0.0 == 0.0<br>
Out[8]: True<br>
<br>
In [9]: -0.0 <  0.0<br>
Out[9]: False<br>
<br>
-Chris<br>
<br>
-- <br>
<br>
Christopher Barker, Ph.D.<br>
Oceanographer<br>
<br>
Emergency Response Division<br>
NOAA/NOS/OR&R            (206) 526-6959   voice<br>
7600 Sand Point Way NE   (206) 526-6329   fax<br>
Seattle, WA  98115       (206) 526-6317   main reception<br>
<br>
<a href="sentmsg?compose&To=Chris.Barker@noaa.gov">Chris.Barker@noaa.gov</a><br>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="sentmsg?compose&To=NumPy%2dDiscussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
</div>
                        
                
                <base target="_self" href="https://e.mail.ru/cgi-bin/">
        </div>

        
</div>


</div>
</blockquote>
<br></BODY></HTML>