master
 1const std = @import("std");
 2const expect = std.testing.expect;
 3
 4/// Returns a * FLT_RADIX ^ exp.
 5///
 6/// Zig only supports binary base IEEE-754 floats. Hence FLT_RADIX=2, and this is an alias for ldexp.
 7pub const scalbn = @import("ldexp.zig").ldexp;
 8
 9test scalbn {
10    // Verify we are using base 2.
11    try expect(scalbn(@as(f16, 1.5), 4) == 24.0);
12    try expect(scalbn(@as(f32, 1.5), 4) == 24.0);
13    try expect(scalbn(@as(f64, 1.5), 4) == 24.0);
14    try expect(scalbn(@as(f128, 1.5), 4) == 24.0);
15}