Sujet : Re: Works !
De : Bonita.Montero (at) *nospam* gmail.com (Bonita Montero)
Groupes : comp.lang.c++Date : 26. May 2025, 12:56:45
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <1011kto$203n4$1@raubtier-asyl.eternal-september.org>
References : 1 2
User-Agent : Mozilla Thunderbird
Am 26.05.2025 um 13:15 schrieb Mr Flibble:
On Mon, 26 May 2025 12:05:41 +0200, Bonita Montero wrote:
strong_ordering fn( float a, float b )
{
partial_ordering po = a <=> b;
if( po == partial_ordering::unordered ) [[unlikely]]
throw invalid_argument( "hello world" );
return bit_cast<strong_ordering>( a <=> b );
}
>
;-)
It is unwise to compare floating point numbers for equality.
So where's the strong_ordering that excludes equal values ?