zig/lib/std/math/epsilon.zig
Andrew Kelley d29871977f remove redundant license headers from zig standard library
We already have a LICENSE file that covers the Zig Standard Library. We
no longer need to remind everyone that the license is MIT in every single
file.

Previously this was introduced to clarify the situation for a fork of
Zig that made Zig's LICENSE file harder to find, and replaced it with
their own license that required annual payments to their company.
However that fork now appears to be dead. So there is no need to
reinforce the copyright notice in every single file.
2021-08-24 12:25:09 -07:00

15 lines
462 B
Zig

const math = @import("../math.zig");
/// Returns the machine epsilon for type T.
/// This is the smallest value of type T that satisfies the inequality 1.0 +
/// epsilon != 1.0.
pub fn epsilon(comptime T: type) T {
return switch (T) {
f16 => math.f16_epsilon,
f32 => math.f32_epsilon,
f64 => math.f64_epsilon,
f128 => math.f128_epsilon,
else => @compileError("epsilon not implemented for " ++ @typeName(T)),
};
}