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:
IOKG04 2025-09-18 16:09:38 +02:00 committed by rpkak
parent aba3e339b8
commit a186bcf22b

View file

@ -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;