Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Private Function

redupif32

Private Function
std.math.complex.atan.redupif32
fn redupif32(x: f32) f32

Params

  • x: f32

File

math/complex/atan.zig:23
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
fn redupif32(x: f32) f32 {
    const DP1 = 3.140625;
    const DP2 = 9.67502593994140625e-4;
    const DP3 = 1.509957990978376432e-7;

    var t = x / math.pi;
    if (t >= 0.0) {
        t += 0.5;
    } else {
        t -= 0.5;
    }

    const u: f32 = @trunc(t);
    return ((x - u * DP1) - u * DP2) - u * DP3;
}