| ... | ... | @@ -46,6 +46,10 @@ comptime { |
| 46 | 46 | |
| 47 | 47 | @export(log10, .{ .name = "log10", .linkage = .Strong }); |
| 48 | 48 | @export(log10f, .{ .name = "log10f", .linkage = .Strong }); |
| 49 | |
| 50 | @export(ceil, .{ .name = "ceil", .linkage = .Strong }); |
| 51 | @export(ceilf, .{ .name = "ceilf", .linkage = .Strong }); |
| 52 | @export(ceill, .{ .name = "ceill", .linkage = .Strong }); |
| 49 | 53 | } |
| 50 | 54 | |
| 51 | 55 | // Avoid dragging in the runtime safety mechanisms into this .o file, |
| ... | ... | @@ -179,3 +183,18 @@ fn log10(a: f64) callconv(.C) f64 { |
| 179 | 183 | fn log10f(a: f32) callconv(.C) f32 { |
| 180 | 184 | return math.log10(a); |
| 181 | 185 | } |
| 186 | |
| 187 | fn ceilf(x: f32) callconv(.C) f32 { |
| 188 | return math.ceil(x); |
| 189 | } |
| 190 | |
| 191 | fn ceil(x: f64) callconv(.C) f64 { |
| 192 | return math.ceil(x); |
| 193 | } |
| 194 | |
| 195 | fn ceill(x: c_longdouble) callconv(.C) c_longdouble { |
| 196 | if (!long_double_is_f128) { |
| 197 | @panic("TODO implement this"); |
| 198 | } |
| 199 | return math.ceil(x); |
| 200 | } |