| author | |
| committer | |
| log | 2ab7f31e99defc62353c3dfed0f6f427c9ac8e80 |
| tree | 202109b1fc2959021d0e5db180a07eecc134e9bc |
| parent | a6c9c5f767217ba3591e51047736f0fa6a975a57 |
| signature |
All four of these can be represented in fewer characters with
expressions, which will be guaranteed to happen at compile-time, and
have the same or better precision.
The other math constants here which depend on function calls could be
similarly removed if and when #425 is solved. However I left them for
now since Zig does not eagerly evaluate functions with comptime parameters.1 files changed, 0 insertions(+), 12 deletions(-)
lib/std/math.zig-12| ... | ... | @@ -25,18 +25,6 @@ pub const ln2 = 0.693147180559945309417232121458176568; |
| 25 | 25 | /// ln(10) |
| 26 | 26 | pub const ln10 = 2.302585092994045684017991454684364208; |
| 27 | 27 | |
| 28 | /// π/2 | |
| 29 | pub const pi_2 = 1.570796326794896619231321691639751442; | |
| 30 | ||
| 31 | /// π/4 | |
| 32 | pub const pi_4 = 0.785398163397448309615660845819875721; | |
| 33 | ||
| 34 | /// 1/π | |
| 35 | pub const one_pi = 0.318309886183790671537767526745028724; | |
| 36 | ||
| 37 | /// 2/π | |
| 38 | pub const two_pi = 0.636619772367581343075535053490057448; | |
| 39 | ||
| 40 | 28 | /// 2/sqrt(π) |
| 41 | 29 | pub const two_sqrtpi = 1.128379167095512573896158903121545172; |
| 42 | 30 |