File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1001,7 +1001,7 @@ function rem2pi(x::Float64, ::RoundingMode{:ToZero})
1001
1001
ax = abs (x)
1002
1002
ax <= 2 * Float64 (pi ,RoundDown) && return x
1003
1003
1004
- n,y = rem_pio2_kernel (x )
1004
+ n,y = rem_pio2_kernel (ax )
1005
1005
1006
1006
if iseven (n)
1007
1007
if n & 2 == 2 # n % 4 == 2: add pi
Original file line number Diff line number Diff line change @@ -2507,6 +2507,14 @@ end
2507
2507
@test rem2pi (T (- 4 ), RoundNearest) ≈ 2pi - 4
2508
2508
@test rem2pi (T (- 4 ), RoundDown) ≈ 2pi - 4
2509
2509
@test rem2pi (T (- 4 ), RoundUp) == - 4
2510
+ @test rem2pi (T (8 ), RoundToZero) ≈ 8 - 2pi
2511
+ @test rem2pi (T (8 ), RoundNearest) ≈ 8 - 2pi
2512
+ @test rem2pi (T (8 ), RoundDown) ≈ 8 - 2pi
2513
+ @test rem2pi (T (8 ), RoundUp) ≈ 8 - 4pi
2514
+ @test rem2pi (T (- 8 ), RoundToZero) ≈ - 8 + 2pi
2515
+ @test rem2pi (T (- 8 ), RoundNearest) ≈ - 8 + 2pi
2516
+ @test rem2pi (T (- 8 ), RoundDown) ≈ - 8 + 4pi
2517
+ @test rem2pi (T (- 8 ), RoundUp) ≈ - 8 + 2pi
2510
2518
end
2511
2519
2512
2520
import Base.^
You can’t perform that action at this time.
0 commit comments