diff options
| author | Marc Tiehuis <marctiehuis@gmail.com> | 2019-05-02 19:05:26 +1200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-02 19:05:26 +1200 |
| commit | f950ec0c16de6dba8a541b1a6453ebe431430782 (patch) | |
| tree | 47df2ed19eece69d35a60eeff8c26511cfe996e3 /std/math/complex/sqrt.zig | |
| parent | c00c18de6a5e436b1c362c06d6e5259c8f731a90 (diff) | |
| parent | 3370e60dd96828db6f9d1da36e71064303e97de6 (diff) | |
| download | zig-f950ec0c16de6dba8a541b1a6453ebe431430782.tar.gz zig-f950ec0c16de6dba8a541b1a6453ebe431430782.zip | |
Merge pull request #2397 from ziglang/std.math
Review std/math and update documentation
Diffstat (limited to 'std/math/complex/sqrt.zig')
| -rw-r--r-- | std/math/complex/sqrt.zig | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/std/math/complex/sqrt.zig b/std/math/complex/sqrt.zig index e935d0b238..36f4c28e29 100644 --- a/std/math/complex/sqrt.zig +++ b/std/math/complex/sqrt.zig @@ -1,9 +1,17 @@ +// Ported from musl, which is licensed under the MIT license: +// https://git.musl-libc.org/cgit/musl/tree/COPYRIGHT +// +// https://git.musl-libc.org/cgit/musl/tree/src/complex/csqrtf.c +// https://git.musl-libc.org/cgit/musl/tree/src/complex/csqrt.c + const std = @import("../../std.zig"); const testing = std.testing; const math = std.math; const cmath = math.complex; const Complex = cmath.Complex; +/// Returns the square root of z. The real and imaginary parts of the result have the same sign +/// as the imaginary part of z. pub fn sqrt(z: var) @typeOf(z) { const T = @typeOf(z.re); |
