This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.
conststd = @import("std");
constexpect = std.testing.expect;
/// Returns a * FLT_RADIX ^ exp.////// Zig only supports binary base IEEE-754 floats. Hence FLT_RADIX=2, and this is an alias for ldexp.pubconstscalbn = @import("ldexp.zig").ldexp;
testscalbn {
// Verify we are using base 2.tryexpect(scalbn(@as(f16, 1.5), 4) == 24.0);
tryexpect(scalbn(@as(f32, 1.5), 4) == 24.0);
tryexpect(scalbn(@as(f64, 1.5), 4) == 24.0);
tryexpect(scalbn(@as(f128, 1.5), 4) == 24.0);
}