mirror of
https://github.com/ziglang/zig.git
synced 2024-11-29 08:32:30 +00:00
4c16f9a3c3
This covers the majority of the functions as covered by the C99 specification for a math library. Code is adapted primarily from musl libc, with the pow and standard trigonometric functions adapted from the Go stdlib. Changes: - Remove assert expose in index and import as needed. - Add float log function and merge with existing base 2 integer implementation. See https://github.com/tiehuis/zig-fmath. See #374.
11 lines
307 B
Zig
11 lines
307 B
Zig
const math = @import("index.zig");
|
|
const assert = @import("../debug.zig").assert;
|
|
|
|
pub fn inf(comptime T: type) -> T {
|
|
switch (T) {
|
|
f32 => @bitCast(f32, math.inf_u32),
|
|
f64 => @bitCast(f64, math.inf_u64),
|
|
else => @compileError("inf not implemented for " ++ @typeName(T)),
|
|
}
|
|
}
|