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.
/Flibble
--- MBSE BBS v1.1.1 (Linux-x86_64)
* Origin: Eweka Internet Services (3:633/280.2@fidonet)