| ... | ... | @@ -14,20 +14,20 @@ comptime { |
| 14 | 14 | symbol(&isnanl, "isnanl"); |
| 15 | 15 | symbol(&isnanl, "__isnanl"); |
| 16 | 16 | |
| 17 | symbol(&math.floatTrueMin(f64), "__DENORM"); |
| 18 | symbol(&math.inf(f64), "__INF"); |
| 17 | 19 | symbol(&math.nan(f64), "__QNAN"); |
| 18 | 20 | symbol(&math.snan(f64), "__SNAN"); |
| 19 | | symbol(&math.inf(f64), "__INF"); |
| 20 | | symbol(&math.floatTrueMin(f64), "__DENORM"); |
| 21 | 21 | |
| 22 | symbol(&math.floatTrueMin(f32), "__DENORMF"); |
| 23 | symbol(&math.inf(f32), "__INFF"); |
| 22 | 24 | symbol(&math.nan(f32), "__QNANF"); |
| 23 | 25 | symbol(&math.snan(f32), "__SNANF"); |
| 24 | | symbol(&math.inf(f32), "__INFF"); |
| 25 | | symbol(&math.floatTrueMin(f32), "__DENORMF"); |
| 26 | 26 | |
| 27 | symbol(&math.floatTrueMin(c_longdouble), "__DENORML"); |
| 28 | symbol(&math.inf(c_longdouble), "__INFL"); |
| 27 | 29 | symbol(&math.nan(c_longdouble), "__QNANL"); |
| 28 | 30 | symbol(&math.snan(c_longdouble), "__SNANL"); |
| 29 | | symbol(&math.inf(c_longdouble), "__INFL"); |
| 30 | | symbol(&math.floatTrueMin(c_longdouble), "__DENORML"); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | if (builtin.target.isMinGW() or builtin.target.isMuslLibC() or builtin.target.isWasiLibC()) { |
| ... | ... | @@ -41,8 +41,9 @@ comptime { |
| 41 | 41 | |
| 42 | 42 | if (builtin.target.isMuslLibC() or builtin.target.isWasiLibC()) { |
| 43 | 43 | symbol(&acos, "acos"); |
| 44 | | symbol(&atanf, "atanf"); |
| 44 | symbol(&acosf, "acosf"); |
| 45 | 45 | symbol(&atan, "atan"); |
| 46 | symbol(&atanf, "atanf"); |
| 46 | 47 | symbol(&atanl, "atanl"); |
| 47 | 48 | symbol(&cbrt, "cbrt"); |
| 48 | 49 | symbol(&cbrtf, "cbrtf"); |
| ... | ... | @@ -53,14 +54,14 @@ comptime { |
| 53 | 54 | symbol(&pow, "pow"); |
| 54 | 55 | symbol(&pow10, "pow10"); |
| 55 | 56 | symbol(&pow10f, "pow10f"); |
| 56 | | symbol(&acosf, "acosf"); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | if (builtin.target.isMuslLibC()) { |
| 60 | | symbol(&copysignf, "copysignf"); |
| 61 | 60 | symbol(&copysign, "copysign"); |
| 61 | symbol(&copysignf, "copysignf"); |
| 62 | 62 | symbol(&rint, "rint"); |
| 63 | 63 | } |
| 64 | |
| 64 | 65 | symbol(&copysignl, "copysignl"); |
| 65 | 66 | } |
| 66 | 67 | |
| ... | ... | @@ -68,14 +69,18 @@ fn acos(x: f64) callconv(.c) f64 { |
| 68 | 69 | return math.acos(x); |
| 69 | 70 | } |
| 70 | 71 | |
| 71 | | fn atanf(x: f32) callconv(.c) f32 { |
| 72 | | return math.atan(x); |
| 72 | fn acosf(x: f32) callconv(.c) f32 { |
| 73 | return std.math.acos(x); |
| 73 | 74 | } |
| 74 | 75 | |
| 75 | 76 | fn atan(x: f64) callconv(.c) f64 { |
| 76 | 77 | return math.atan(x); |
| 77 | 78 | } |
| 78 | 79 | |
| 80 | fn atanf(x: f32) callconv(.c) f32 { |
| 81 | return math.atan(x); |
| 82 | } |
| 83 | |
| 79 | 84 | fn atanl(x: c_longdouble) callconv(.c) c_longdouble { |
| 80 | 85 | return switch (@typeInfo(@TypeOf(x)).float.bits) { |
| 81 | 86 | 16 => math.atan(@as(f16, @floatCast(x))), |
| ... | ... | @@ -87,39 +92,19 @@ fn atanl(x: c_longdouble) callconv(.c) c_longdouble { |
| 87 | 92 | }; |
| 88 | 93 | } |
| 89 | 94 | |
| 90 | | fn acosf(x: f32) callconv(.c) f32 { |
| 91 | | return std.math.acos(x); |
| 92 | | } |
| 93 | | |
| 94 | | fn isnan(x: f64) callconv(.c) c_int { |
| 95 | | return if (math.isNan(x)) 1 else 0; |
| 96 | | } |
| 97 | | |
| 98 | | fn isnanf(x: f32) callconv(.c) c_int { |
| 99 | | return if (math.isNan(x)) 1 else 0; |
| 100 | | } |
| 101 | | |
| 102 | | fn isnanl(x: c_longdouble) callconv(.c) c_int { |
| 103 | | return if (math.isNan(x)) 1 else 0; |
| 104 | | } |
| 105 | | |
| 106 | | fn nan(_: [*:0]const c_char) callconv(.c) f64 { |
| 107 | | return math.nan(f64); |
| 108 | | } |
| 109 | | |
| 110 | | fn nanf(_: [*:0]const c_char) callconv(.c) f32 { |
| 111 | | return math.nan(f32); |
| 95 | fn cbrt(x: f64) callconv(.c) f64 { |
| 96 | return math.cbrt(x); |
| 112 | 97 | } |
| 113 | 98 | |
| 114 | | fn nanl(_: [*:0]const c_char) callconv(.c) c_longdouble { |
| 115 | | return math.nan(c_longdouble); |
| 99 | fn cbrtf(x: f32) callconv(.c) f32 { |
| 100 | return math.cbrt(x); |
| 116 | 101 | } |
| 117 | 102 | |
| 118 | | fn copysignf(x: f32, y: f32) callconv(.c) f32 { |
| 103 | fn copysign(x: f64, y: f64) callconv(.c) f64 { |
| 119 | 104 | return math.copysign(x, y); |
| 120 | 105 | } |
| 121 | 106 | |
| 122 | | fn copysign(x: f64, y: f64) callconv(.c) f64 { |
| 107 | fn copysignf(x: f32, y: f32) callconv(.c) f32 { |
| 123 | 108 | return math.copysign(x, y); |
| 124 | 109 | } |
| 125 | 110 | |
| ... | ... | @@ -135,14 +120,6 @@ fn coshf(x: f32) callconv(.c) f32 { |
| 135 | 120 | return math.cosh(x); |
| 136 | 121 | } |
| 137 | 122 | |
| 138 | | fn cbrt(x: f64) callconv(.c) f64 { |
| 139 | | return math.cbrt(x); |
| 140 | | } |
| 141 | | |
| 142 | | fn cbrtf(x: f32) callconv(.c) f32 { |
| 143 | | return math.cbrt(x); |
| 144 | | } |
| 145 | | |
| 146 | 123 | fn exp10(x: f64) callconv(.c) f64 { |
| 147 | 124 | return math.pow(f64, 10.0, x); |
| 148 | 125 | } |
| ... | ... | @@ -163,6 +140,30 @@ fn hypotl(x: c_longdouble, y: c_longdouble) callconv(.c) c_longdouble { |
| 163 | 140 | return math.hypot(x, y); |
| 164 | 141 | } |
| 165 | 142 | |
| 143 | fn isnan(x: f64) callconv(.c) c_int { |
| 144 | return if (math.isNan(x)) 1 else 0; |
| 145 | } |
| 146 | |
| 147 | fn isnanf(x: f32) callconv(.c) c_int { |
| 148 | return if (math.isNan(x)) 1 else 0; |
| 149 | } |
| 150 | |
| 151 | fn isnanl(x: c_longdouble) callconv(.c) c_int { |
| 152 | return if (math.isNan(x)) 1 else 0; |
| 153 | } |
| 154 | |
| 155 | fn nan(_: [*:0]const c_char) callconv(.c) f64 { |
| 156 | return math.nan(f64); |
| 157 | } |
| 158 | |
| 159 | fn nanf(_: [*:0]const c_char) callconv(.c) f32 { |
| 160 | return math.nan(f32); |
| 161 | } |
| 162 | |
| 163 | fn nanl(_: [*:0]const c_char) callconv(.c) c_longdouble { |
| 164 | return math.nan(c_longdouble); |
| 165 | } |
| 166 | |
| 166 | 167 | fn pow(x: f64, y: f64) callconv(.c) f64 { |
| 167 | 168 | return math.pow(f64, x, y); |
| 168 | 169 | } |