DoxigAlpha

isPositiveZero

Returns whether x is positive zero.

Function parameters

Parameters

#
x:anytype

Returns whether x is positive zero.

Functions

#
isPositiveZero
Returns whether x is positive zero.
isNegativeZero
Returns whether x is negative zero.

Source

Implementation

#
pub inline fn isPositiveZero(x: anytype) bool {
    const T = @TypeOf(x);
    const bit_count = @typeInfo(T).float.bits;
    const TBits = std.meta.Int(.unsigned, bit_count);
    return @as(TBits, @bitCast(x)) == @as(TBits, 0);
}