authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-10-16 18:32:26-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-10-16 18:33:12-04:00
log7598a579ff5f4db43a53c4a466b4b37263726b4b
tree96a11d204b7d366e87a056b44228ac85be6b6669
parent1b07ff7be04d9d193425302f79f5b2cfec02da0a
signaturelock-open Commit is signed but in an unrecognized format.

turn comments into doc comments


1 files changed, 33 insertions(+), 11 deletions(-)

lib/std/math.zig+33-11
...@@ -9,17 +9,39 @@ pub const e = 2.71828182845904523536028747135266249775724709369995;...@@ -9,17 +9,39 @@ pub const e = 2.71828182845904523536028747135266249775724709369995;
99
10/// Archimedes' constant (π)10/// Archimedes' constant (π)
11pub const pi = 3.14159265358979323846264338327950288419716939937510;11pub const pi = 3.14159265358979323846264338327950288419716939937510;
12pub const log2e = 1.442695040888963407359924681001892137; // log2(e)12
13pub const log10e = 0.434294481903251827651128918916605082; // log10(e)13/// log2(e)
14pub const ln2 = 0.693147180559945309417232121458176568; // ln(2)14pub const log2e = 1.442695040888963407359924681001892137;
15pub const ln10 = 2.302585092994045684017991454684364208; // ln(10)15
16pub const pi_2 = 1.570796326794896619231321691639751442; // pi/216/// log10(e)
17pub const pi_4 = 0.785398163397448309615660845819875721; // pi/417pub const log10e = 0.434294481903251827651128918916605082;
18pub const one_pi = 0.318309886183790671537767526745028724; // 1/pi18
19pub const two_pi = 0.636619772367581343075535053490057448; // 2/pi19/// ln(2)
20pub const two_sqrtpi = 1.128379167095512573896158903121545172; // 2/sqrt(pi)20pub const ln2 = 0.693147180559945309417232121458176568;
21pub const sqrt2 = 1.414213562373095048801688724209698079; // sqrt(2)21
22pub const sqrt1_2 = 0.707106781186547524400844362104849039; // 1/sqrt(2)22/// ln(10)
23pub const ln10 = 2.302585092994045684017991454684364208;
24
25/// π/2
26pub const pi_2 = 1.570796326794896619231321691639751442;
27
28/// π/4
29pub const pi_4 = 0.785398163397448309615660845819875721;
30
31/// 1/π
32pub const one_pi = 0.318309886183790671537767526745028724;
33
34/// 2/π
35pub const two_pi = 0.636619772367581343075535053490057448;
36
37/// 2/sqrt(π)
38pub const two_sqrtpi = 1.128379167095512573896158903121545172;
39
40/// sqrt(2)
41pub const sqrt2 = 1.414213562373095048801688724209698079;
42
43/// 1/sqrt(2)
44pub const sqrt1_2 = 0.707106781186547524400844362104849039;
2345
24// From a small c++ [program using boost float128](https://github.com/winksaville/cpp_boost_float128)46// From a small c++ [program using boost float128](https://github.com/winksaville/cpp_boost_float128)
25pub const f128_true_min = @bitCast(f128, u128(0x00000000000000000000000000000001));47pub const f128_true_min = @bitCast(f128, u128(0x00000000000000000000000000000001));