diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-10-16 18:32:26 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-10-16 18:33:12 -0400 |
| commit | 7598a579ff5f4db43a53c4a466b4b37263726b4b (patch) | |
| tree | 96a11d204b7d366e87a056b44228ac85be6b6669 /lib/std/math.zig | |
| parent | 1b07ff7be04d9d193425302f79f5b2cfec02da0a (diff) | |
| download | zig-7598a579ff5f4db43a53c4a466b4b37263726b4b.tar.gz zig-7598a579ff5f4db43a53c4a466b4b37263726b4b.zip | |
turn comments into doc comments
Diffstat (limited to 'lib/std/math.zig')
| -rw-r--r-- | lib/std/math.zig | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/lib/std/math.zig b/lib/std/math.zig index 18d4633701..9e13bc91a0 100644 --- a/lib/std/math.zig +++ b/lib/std/math.zig @@ -9,17 +9,39 @@ pub const e = 2.71828182845904523536028747135266249775724709369995; /// Archimedes' constant (π) pub const pi = 3.14159265358979323846264338327950288419716939937510; -pub const log2e = 1.442695040888963407359924681001892137; // log2(e) -pub const log10e = 0.434294481903251827651128918916605082; // log10(e) -pub const ln2 = 0.693147180559945309417232121458176568; // ln(2) -pub const ln10 = 2.302585092994045684017991454684364208; // ln(10) -pub const pi_2 = 1.570796326794896619231321691639751442; // pi/2 -pub const pi_4 = 0.785398163397448309615660845819875721; // pi/4 -pub const one_pi = 0.318309886183790671537767526745028724; // 1/pi -pub const two_pi = 0.636619772367581343075535053490057448; // 2/pi -pub const two_sqrtpi = 1.128379167095512573896158903121545172; // 2/sqrt(pi) -pub const sqrt2 = 1.414213562373095048801688724209698079; // sqrt(2) -pub const sqrt1_2 = 0.707106781186547524400844362104849039; // 1/sqrt(2) + +/// log2(e) +pub const log2e = 1.442695040888963407359924681001892137; + +/// log10(e) +pub const log10e = 0.434294481903251827651128918916605082; + +/// ln(2) +pub const ln2 = 0.693147180559945309417232121458176568; + +/// ln(10) +pub const ln10 = 2.302585092994045684017991454684364208; + +/// π/2 +pub const pi_2 = 1.570796326794896619231321691639751442; + +/// π/4 +pub const pi_4 = 0.785398163397448309615660845819875721; + +/// 1/π +pub const one_pi = 0.318309886183790671537767526745028724; + +/// 2/π +pub const two_pi = 0.636619772367581343075535053490057448; + +/// 2/sqrt(π) +pub const two_sqrtpi = 1.128379167095512573896158903121545172; + +/// sqrt(2) +pub const sqrt2 = 1.414213562373095048801688724209698079; + +/// 1/sqrt(2) +pub const sqrt1_2 = 0.707106781186547524400844362104849039; // From a small c++ [program using boost float128](https://github.com/winksaville/cpp_boost_float128) pub const f128_true_min = @bitCast(f128, u128(0x00000000000000000000000000000001)); |
