diff options
Diffstat (limited to 'lib/compiler_rt/log.zig')
| -rw-r--r-- | lib/compiler_rt/log.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/compiler_rt/log.zig b/lib/compiler_rt/log.zig index 8b09baac2e..6e705dae60 100644 --- a/lib/compiler_rt/log.zig +++ b/lib/compiler_rt/log.zig @@ -131,6 +131,17 @@ pub fn logq(a: f128) callconv(.C) f128 { return log(@floatCast(f64, a)); } +pub fn logl(x: c_longdouble) callconv(.C) c_longdouble { + switch (@typeInfo(c_longdouble).Float.bits) { + 16 => return __logh(x), + 32 => return logf(x), + 64 => return log(x), + 80 => return __logx(x), + 128 => return logq(x), + else => @compileError("unreachable"), + } +} + test "ln32" { const epsilon = 0.000001; |
