#Get the smallest positive float number
1 messages · Page 1 of 1 (latest)
There are std.math.floatMin and std.math.floatTrueMin.
const std = @import("std");
pub fn main() void {
std.debug.print("{d}\n{d}\n", .{ std.math.floatMin(f64), std.math.floatTrueMin(f64) });
}
output:
0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022250738585072014
0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005
What is the difference between them?
I see that one is lesser than the other, but why?
from the docs, floatMin is the smallest number excluding subnormals and floatTrueMin does count subnormals
Hmm, I should look into what subnormals are.