mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
change assert to evaluate at comptime for approxEqRel
Signed-off-by: Michael Pollind <mpollind@gmail.com>
This commit is contained in:
parent
5bf52a6f50
commit
c195278b9e
1 changed files with 1 additions and 1 deletions
|
|
@ -102,7 +102,7 @@ pub fn approxEqAbs(comptime T: type, x: T, y: T, tolerance: T) bool {
|
|||
///
|
||||
/// NaN values are never considered equal to any value.
|
||||
pub fn approxEqRel(comptime T: type, x: T, y: T, tolerance: T) bool {
|
||||
assert(@typeInfo(T) == .float or @typeInfo(T) == .comptime_float);
|
||||
comptime assert(@typeInfo(T) == .float or @typeInfo(T) == .comptime_float);
|
||||
assert(tolerance > 0);
|
||||
|
||||
// Fast path for equal values (and signed zeros and infinites).
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue