# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #125216]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=125216 >


<AlexDaniel> m: say -1/Inf;
<camelia> rakudo-moar 3fc98b: OUTPUT«-0␤»
<AlexDaniel> -0?
<masak> sure!
<masak> -0 is a totally cromulent IEEE 754 number.
* FROGGS .oO( why so negative? )
<masak> m: say -0e0 < 0e0
<camelia> rakudo-moar 3fc98b: OUTPUT«False␤»
<masak> m: say -0e0 == 0e0
<camelia> rakudo-moar 3fc98b: OUTPUT«True␤»

(everything kosher up until this point)

<masak> m: say -0e0 === 0e0
<camelia> rakudo-moar 3fc98b: OUTPUT«True␤»
<masak> one could argue that that last one should be False... :)
<masak> m: say -0e0
<camelia> rakudo-moar 3fc98b: OUTPUT«-0␤»
<masak> yeah, this is not how I'd expect === to behave.
<masak> it should be more discriminating than ==
<masak> and be able to pick out that those are actually two distinct
values (that happen to be numerically equal)
<AlexDaniel> masak: and what's the difference between -0e1 and -1/Inf ?
<masak> nothing, IMO. they're the exact same value.
<AlexDaniel> masak: but then why did you say "this is not how I'd
expect === to behave"?
<masak> m: say -0e0 === 0e0
<camelia> rakudo-moar 3fc98b: OUTPUT«True␤»
<masak> because of that.
<AlexDaniel> oh ok
<AlexDaniel> got it
<masak> I'm fine with them being numerically equals (because they're
the same point on the real line)
<masak> but I'd expect === to be able to pick them apart, because ===
is not encumbered with notions of number-ness
<masak> now I'm going to submit this and make it look like I wrote all
the right things from the start :P
<TimToady> eqv and === on floaters should probably just compare chunks of memory

Reply via email to