Function nextAfter [src]

Alias for std.math.nextafter.nextAfter

Returns the next representable value after x in the direction of y. Special cases: If x == y, y is returned. For floats, if either x or y is a NaN, a NaN is returned. For floats, if x == 0.0 and @abs(y) > 0.0, the smallest subnormal number with the sign of y is returned.

Prototype

pub fn nextAfter(comptime T: type, x: T, y: T) T

Parameters

T: typex: Ty: T

Source

pub fn nextAfter(comptime T: type, x: T, y: T) T { return switch (@typeInfo(T)) { .int, .comptime_int => nextAfterInt(T, x, y), .float => nextAfterFloat(T, x, y), else => @compileError("expected int or non-comptime float, found '" ++ @typeName(T) ++ "'"), }; }