@@ -2676,6 +2676,24 @@ end
26762676 @test rem2pi (T (- 8 ), RoundNearest) ≈ - 8 + 2pi
26772677 @test rem2pi (T (- 8 ), RoundDown) ≈ - 8 + 4pi
26782678 @test rem2pi (T (- 8 ), RoundUp) ≈ - 8 + 2pi
2679+ # to hit n is even and n % 4 == 2 condition
2680+ @test rem2pi (T (3 ), RoundToZero) == 3
2681+ @test rem2pi (T (3 ), RoundNearest) == 3
2682+ @test rem2pi (T (3 ), RoundDown) == 3
2683+ @test rem2pi (T (3 ), RoundUp) ≈ 3 - 2 π
2684+ @test rem2pi (T (- 3 ), RoundToZero) == - 3
2685+ @test rem2pi (T (- 3 ), RoundNearest) == - 3
2686+ @test rem2pi (T (- 3 ), RoundDown) ≈ - 3 + 2 π
2687+ @test rem2pi (T (- 3 ), RoundUp) == - 3
2688+ # to hit even n condition and n % 4 != 2 condition
2689+ @test rem2pi (T (13 ), RoundToZero) ≈ 13 - 4 π
2690+ @test rem2pi (T (13 ), RoundNearest) ≈ 13 - 4 π
2691+ @test rem2pi (T (13 ), RoundDown) ≈ 13 - 4 π
2692+ @test rem2pi (T (13 ), RoundUp) ≈ 13 - 6 π
2693+ @test rem2pi (T (- 13 ), RoundToZero) ≈ - 13 + 4 π
2694+ @test rem2pi (T (- 13 ), RoundNearest) ≈ - 13 + 4 π
2695+ @test rem2pi (T (- 13 ), RoundDown) ≈ - 13 + 6 π
2696+ @test rem2pi (T (- 13 ), RoundUp) ≈ - 13 + 4 π
26792697end
26802698
26812699@testset " PR #36420 $T " for T in (Float16, Float32, Float64)
0 commit comments