mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
replace assertions with comptime assertions
also I'll take this commit message to note that these tests aren't perfect, some goodness of fit test like for the normal `float` function would be better, but this should still catch any *big* mistake done in implementation.
This commit is contained in:
parent
aba3e339b8
commit
a186bcf22b
1 changed files with 2 additions and 2 deletions
|
|
@ -58,7 +58,7 @@ pub fn next(comptime T: type, random: Random, comptime tables: Table(T)) T {
|
|||
}
|
||||
|
||||
pub fn Table(comptime T: type) type {
|
||||
std.debug.assert(@typeInfo(T) == .float);
|
||||
comptime std.debug.assert(@typeInfo(T) == .float);
|
||||
return struct {
|
||||
x: [257]T,
|
||||
f: [257]T,
|
||||
|
|
@ -105,7 +105,7 @@ pub fn tableGen(
|
|||
|
||||
/// Namespace containing distributions for a specific floating point type.
|
||||
pub fn distributions(comptime T: type) type {
|
||||
std.debug.assert(@typeInfo(T) == .float);
|
||||
comptime std.debug.assert(@typeInfo(T) == .float);
|
||||
return struct {
|
||||
pub const norm_r = 3.6541528853610088;
|
||||
pub const norm_v = 0.00492867323399;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue