github.com/aykevl/tinygo@v0.5.0/src/runtime/math.go (about) 1 package runtime 2 3 // This file redirects math stubs to their fallback implementation. 4 // TODO: use optimized versions if possible. 5 6 import ( 7 _ "unsafe" 8 ) 9 10 //go:linkname math_Asin math.Asin 11 func math_Asin(x float64) float64 { return math_asin(x) } 12 13 //go:linkname math_asin math.asin 14 func math_asin(x float64) float64 15 16 //go:linkname math_Asinh math.Asinh 17 func math_Asinh(x float64) float64 { return math_asinh(x) } 18 19 //go:linkname math_asinh math.asinh 20 func math_asinh(x float64) float64 21 22 //go:linkname math_Acos math.Acos 23 func math_Acos(x float64) float64 { return math_acos(x) } 24 25 //go:linkname math_acos math.acos 26 func math_acos(x float64) float64 27 28 //go:linkname math_Acosh math.Acosh 29 func math_Acosh(x float64) float64 { return math_acosh(x) } 30 31 //go:linkname math_acosh math.acosh 32 func math_acosh(x float64) float64 33 34 //go:linkname math_Atan math.Atan 35 func math_Atan(x float64) float64 { return math_atan(x) } 36 37 //go:linkname math_atan math.atan 38 func math_atan(x float64) float64 39 40 //go:linkname math_Atanh math.Atanh 41 func math_Atanh(x float64) float64 { return math_atanh(x) } 42 43 //go:linkname math_atanh math.atanh 44 func math_atanh(x float64) float64 45 46 //go:linkname math_Atan2 math.Atan2 47 func math_Atan2(y, x float64) float64 { return math_atan2(y, x) } 48 49 //go:linkname math_atan2 math.atan2 50 func math_atan2(y, x float64) float64 51 52 //go:linkname math_Cbrt math.Cbrt 53 func math_Cbrt(x float64) float64 { return math_cbrt(x) } 54 55 //go:linkname math_cbrt math.cbrt 56 func math_cbrt(x float64) float64 57 58 //go:linkname math_Ceil math.Ceil 59 func math_Ceil(x float64) float64 { return math_ceil(x) } 60 61 //go:linkname math_ceil math.ceil 62 func math_ceil(x float64) float64 63 64 //go:linkname math_Cos math.Cos 65 func math_Cos(x float64) float64 { return math_cos(x) } 66 67 //go:linkname math_cos math.cos 68 func math_cos(x float64) float64 69 70 //go:linkname math_Cosh math.Cosh 71 func math_Cosh(x float64) float64 { return math_cosh(x) } 72 73 //go:linkname math_cosh math.cosh 74 func math_cosh(x float64) float64 75 76 //go:linkname math_Erf math.Erf 77 func math_Erf(x float64) float64 { return math_erf(x) } 78 79 //go:linkname math_erf math.erf 80 func math_erf(x float64) float64 81 82 //go:linkname math_Erfc math.Erfc 83 func math_Erfc(x float64) float64 { return math_erfc(x) } 84 85 //go:linkname math_erfc math.erfc 86 func math_erfc(x float64) float64 87 88 //go:linkname math_Exp math.Exp 89 func math_Exp(x float64) float64 { return math_exp(x) } 90 91 //go:linkname math_exp math.exp 92 func math_exp(x float64) float64 93 94 //go:linkname math_Expm1 math.Expm1 95 func math_Expm1(x float64) float64 { return math_expm1(x) } 96 97 //go:linkname math_expm1 math.expm1 98 func math_expm1(x float64) float64 99 100 //go:linkname math_Exp2 math.Exp2 101 func math_Exp2(x float64) float64 { return math_exp2(x) } 102 103 //go:linkname math_exp2 math.exp2 104 func math_exp2(x float64) float64 105 106 //go:linkname math_Floor math.Floor 107 func math_Floor(x float64) float64 { return math_floor(x) } 108 109 //go:linkname math_floor math.floor 110 func math_floor(x float64) float64 111 112 //go:linkname math_Frexp math.Frexp 113 func math_Frexp(x float64) (float64, int) { return math_frexp(x) } 114 115 //go:linkname math_frexp math.frexp 116 func math_frexp(x float64) (float64, int) 117 118 //go:linkname math_Hypot math.Hypot 119 func math_Hypot(p, q float64) float64 { return math_hypot(p, q) } 120 121 //go:linkname math_hypot math.hypot 122 func math_hypot(p, q float64) float64 123 124 //go:linkname math_Ldexp math.Ldexp 125 func math_Ldexp(frac float64, exp int) float64 { return math_ldexp(frac, exp) } 126 127 //go:linkname math_ldexp math.ldexp 128 func math_ldexp(frac float64, exp int) float64 129 130 //go:linkname math_Log math.Log 131 func math_Log(x float64) float64 { return math_log(x) } 132 133 //go:linkname math_log math.log 134 func math_log(x float64) float64 135 136 //go:linkname math_Log1p math.Log1p 137 func math_Log1p(x float64) float64 { return math_log1p(x) } 138 139 //go:linkname math_log1p math.log1p 140 func math_log1p(x float64) float64 141 142 //go:linkname math_Log10 math.Log10 143 func math_Log10(x float64) float64 { return math_log10(x) } 144 145 //go:linkname math_log10 math.log10 146 func math_log10(x float64) float64 147 148 //go:linkname math_Log2 math.Log2 149 func math_Log2(x float64) float64 { return math_log2(x) } 150 151 //go:linkname math_log2 math.log2 152 func math_log2(x float64) float64 153 154 //go:linkname math_Max math.Max 155 func math_Max(x, y float64) float64 { return math_max(x, y) } 156 157 //go:linkname math_max math.max 158 func math_max(x, y float64) float64 159 160 //go:linkname math_Min math.Min 161 func math_Min(x, y float64) float64 { return math_min(x, y) } 162 163 //go:linkname math_min math.min 164 func math_min(x, y float64) float64 165 166 //go:linkname math_Mod math.Mod 167 func math_Mod(x, y float64) float64 { return math_mod(x, y) } 168 169 //go:linkname math_mod math.mod 170 func math_mod(x, y float64) float64 171 172 //go:linkname math_Modf math.Modf 173 func math_Modf(x float64) (float64, float64) { return math_modf(x) } 174 175 //go:linkname math_modf math.modf 176 func math_modf(x float64) (float64, float64) 177 178 //go:linkname math_Pow math.Pow 179 func math_Pow(x, y float64) float64 { return math_pow(x, y) } 180 181 //go:linkname math_pow math.pow 182 func math_pow(x, y float64) float64 183 184 //go:linkname math_Remainder math.Remainder 185 func math_Remainder(x, y float64) float64 { return math_remainder(x, y) } 186 187 //go:linkname math_remainder math.remainder 188 func math_remainder(x, y float64) float64 189 190 //go:linkname math_Sin math.Sin 191 func math_Sin(x float64) float64 { return math_sin(x) } 192 193 //go:linkname math_sin math.sin 194 func math_sin(x float64) float64 195 196 //go:linkname math_Sinh math.Sinh 197 func math_Sinh(x float64) float64 { return math_sinh(x) } 198 199 //go:linkname math_sinh math.sinh 200 func math_sinh(x float64) float64 201 202 //go:linkname math_Sqrt math.Sqrt 203 func math_Sqrt(x float64) float64 { return math_sqrt(x) } 204 205 //go:linkname math_sqrt math.sqrt 206 func math_sqrt(x float64) float64 207 208 //go:linkname math_Tan math.Tan 209 func math_Tan(x float64) float64 { return math_tan(x) } 210 211 //go:linkname math_tan math.tan 212 func math_tan(x float64) float64 213 214 //go:linkname math_Tanh math.Tanh 215 func math_Tanh(x float64) float64 { return math_tanh(x) } 216 217 //go:linkname math_tanh math.tanh 218 func math_tanh(x float64) float64 219 220 //go:linkname math_Trunc math.Trunc 221 func math_Trunc(x float64) float64 { return math_trunc(x) } 222 223 //go:linkname math_trunc math.trunc 224 func math_trunc(x float64) float64