Skip to content

FloatLT

Description

Test whether lhs is strictly less than rhs.

Parameters

Name Direction Description
lhs in Left-hand float
rhs in Right-hand operand selected through generic dispatch

Usage example (from documentation)

  bool smaller = FloatLT(&value, other);

Success

Returns true when lhs < rhs.

Failure

Returns false otherwise. Neither operand is modified.

Usage example (Cross-references)

Usage examples (Cross-references)
        Float c = FloatFromStr(FLOAT_TEST_VERY_LARGE_ONES, &alloc.base);
    
        bool result = FloatLT(&a, &b);
        result      = result && FloatGT(&b, &a);
        result      = result && (FloatCompare(&a, &c) == 0);
    
        bool result = FloatGT(&large, &small);
        result      = result && FloatLT(&negative_large, &small);
        result      = result && FloatNE(&large, &small);
        Float expected = FloatFromStr("5e-1", &alloc.base);
    
        bool result = FloatLT(&a, &b);
        result      = result && FloatLE(&a, &b);
        result      = result && FloatGT(&b, &a);
        Float tiny = FloatFrom(0x1p-149f, &alloc.base);
    
        bool result = FloatLT(&tiny, 1.0f) && FloatGT(&tiny, 0.0f);
    
        FloatDeinit(&tiny);
        Float tiny = FloatFrom(0x1p-1074, &alloc.base);
    
        bool result = FloatLT(&tiny, 1.0) && FloatGT(&tiny, 0.0);
    
        FloatDeinit(&tiny);
Last updated on