Always false float comparisons

ag0aep6g via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 29 12:12:24 PDT 2017


On Thursday, 29 June 2017 at 18:03:39 UTC, Ecstatic Coder wrote:
> I often do code like "x < array.length" where x needs to be a 
> long to be able to handle negative values.
>
> I want my code to compile without warning, and therefore I'm 
> against requiring "x < array.length.to!long()" to remove that 
> warning.

`x < array.length` and `x < array.length.to!long` have different 
results when x is negative. That's why a warning/error is in 
order.


More information about the Digitalmars-d mailing list