Why D is annoying =P

Mehrdad wfunction at hotmail.com
Mon Oct 29 19:27:28 PDT 2012


On Monday, 29 October 2012 at 19:55:41 UTC, Rob T wrote:
> On Monday, 29 October 2012 at 18:39:41 UTC, H. S. Teoh wrote:
>> On Mon, Oct 29, 2012 at 06:34:14PM +0100, Rob T wrote:
>> [...]
>>> There is a problem with floating point memebers, since nan 
>>> values will
>>> always compare false.
>>
>> This is IEEE specification. There is no problem.
>>
>>
>> T
>
> If struc comparisions compare value by value, and both have Nan 
> values in one member variable, then the two otherwise 
> completely identical structs will always compare false even 
> though they are identical. I think it would be best to have the 
> ability to compare structs in two ways, one as struct 
> equivalence, which would be the default method, the other as 
> vale by value equivalence, which would have to be programmer 
> defined through overload of == operator.
>
> --rt


I understand the problem, but it doesn't seem related to structs 
at all.

Any two attempts to compare two default-valued floats will fail, 
irrespective of whether or not they're inside structs.


More information about the Digitalmars-d mailing list