File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 353
353
end
354
354
355
355
@testset " rounding floats with specified return type #50778" begin
356
- @test round (Float64, 1.2 ) == 1
357
- @test round (Float32, 1e60 ) == Inf32
356
+ @test round (Float64, 1.2 ) === 1.0
357
+ @test round (Float32, 1e60 ) === Inf32
358
358
x = floatmax (Float32)- 1.0
359
359
@test round (Float32, x) == x
360
360
end
361
+
362
+ @testset " rounding complex numbers (#42060)" begin
363
+ @test ceil (Complex (4.6 , 2.2 )) === Complex (5.0 , 3.0 )
364
+ @test floor (Complex (4.6 , 2.2 )) === Complex (4.0 , 2.0 )
365
+ @test trunc (Complex (4.6 , 2.2 )) === Complex (4.0 , 2.0 )
366
+ @test round (Complex (4.6 , 2.2 )) === Complex (5.0 , 2.0 )
367
+ @test ceil (Complex (- 4.6 , - 2.2 )) === Complex (- 4.0 , - 2.0 )
368
+ @test floor (Complex (- 4.6 , - 2.2 )) === Complex (- 5.0 , - 3.0 )
369
+ @test trunc (Complex (- 4.6 , - 2.2 )) === Complex (- 4.0 , - 2.0 )
370
+ @test round (Complex (- 4.6 , - 2.2 )) === Complex (- 5.0 , - 2.0 )
371
+ end
You can’t perform that action at this time.
0 commit comments