|
318 | 318 | @test norm(SA[SVector{0,Int}(),SVector{0,Int}()]) isa float(Int)
|
319 | 319 | @test norm(SA[SVector{0,Int}(),SVector{0,Int}()]) == norm([Int[], Int[]])
|
320 | 320 |
|
| 321 | + # norm of SVector with NaN and/or Inf elements -- issue #1135 |
| 322 | + @test isnan(norm(SA[0.0, NaN])) |
| 323 | + @test isnan(norm(SA[NaN, 0.0])) |
| 324 | + @test norm(SA[0.0, Inf]) == Inf |
| 325 | + @test norm(SA[Inf, 0.0]) == Inf |
| 326 | + @test norm(SA[0.0, -Inf]) == Inf |
| 327 | + @test norm(SA[-Inf, 0.0]) == Inf |
| 328 | + @test norm(SA[Inf, Inf]) == Inf |
| 329 | + @test norm(SA[-Inf, -Inf]) == Inf |
| 330 | + @test norm(SA[Inf, -Inf]) == Inf |
| 331 | + @test norm(SA[-Inf, Inf]) == Inf |
| 332 | + @test isnan(norm(SA[Inf, NaN])) |
| 333 | + @test isnan(norm(SA[NaN, Inf])) |
| 334 | + @test isnan(norm(SA[-Inf, NaN])) |
| 335 | + @test isnan(norm(SA[NaN, -Inf])) |
| 336 | + @test isapprox(SA[0.0, NaN], SA[0.0, NaN], nans=true) |
| 337 | + |
321 | 338 | # no allocation for MArray -- issue #1126
|
322 | 339 |
|
323 | 340 | @inline function calc_particle_forces!(s, pos1, pos2)
|
|
0 commit comments