Skip to content

IntIsOne

Description

Test whether the integer equals one.

Parameters

Name Direction Description
value in Integer to inspect.

Success

Returns true when the integer equals one.

Failure

Returns false otherwise.

Usage example (Cross-references)

Usage examples (Cross-references)
    }
    
    bool IntIsOne(const Int *value) {
        return int_is_one(value);
    }
    
    bool test_int_is_one(void) {
        WriteFmt("Testing IntIsOne\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        Int two = IntFrom(2, &alloc.base);
    
        bool result = IntIsOne(&one);
        result      = result && !IntIsOne(&two);
    
        bool result = IntIsOne(&one);
        result      = result && !IntIsOne(&two);
    
        IntDeinit(&one);
Last updated on