• Works !

    From Bonita Montero@3:633/280.2 to All on Mon May 26 20:05:41 2025
    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 );
    }

    ;-)

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Mr Flibble@3:633/280.2 to All on Mon May 26 21:15:02 2025
    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)
  • From Bonita Montero@3:633/280.2 to All on Mon May 26 21:56:45 2025
    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 ?


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)