This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Function
nextAfter
Public Function
std.math.nextafter.nextAfter
pubfnnextAfter(comptimeT: type, x: T, y: T) T
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.
Params
T: type
x: T
y: T
File
math/nextafter.zig:15
15161718192021
pubfnnextAfter(comptimeT: type, x: T, y: T) T {
returnswitch (@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) ++ "'"),
};
}
Returns the next representable value after
xin the direction ofy.Special cases:
x == y,yis returned.xoryis a NaN, a NaN is returned.x == 0.0and@abs(y) > 0.0, the smallest subnormal number with the sign ofyis returned.