Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change ≅ to ≣ in numbers.jl tests #18599

Merged
merged 1 commit into from
Sep 20, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions test/numbers.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

const ≣ = isequal # convenient for comparing NaNs

# basic booleans
@test true
@test !false
Expand Down Expand Up @@ -54,41 +56,39 @@
@test 2.0 * 3.0 == 6.
@test min(1.0,1) == 1

const ≅ = isequal # convenient for comparing NaNs

# min, max and minmax
@test min(1) === 1
@test max(1) === 1
@test minmax(1) === (1, 1)
@test minmax(5, 3) == (3, 5)
@test minmax(3., 5.) == (3., 5.)
@test minmax(5., 3.) == (3., 5.)
@test minmax(3., NaN) (NaN, NaN)
@test minmax(NaN, 3) (NaN, NaN)
@test minmax(Inf, NaN) (NaN, NaN)
@test minmax(NaN, Inf) (NaN, NaN)
@test minmax(-Inf, NaN) (NaN, NaN)
@test minmax(NaN, -Inf) (NaN, NaN)
@test minmax(NaN, NaN) (NaN, NaN)
@test minmax(3., NaN) (NaN, NaN)
@test minmax(NaN, 3) (NaN, NaN)
@test minmax(Inf, NaN) (NaN, NaN)
@test minmax(NaN, Inf) (NaN, NaN)
@test minmax(-Inf, NaN) (NaN, NaN)
@test minmax(NaN, -Inf) (NaN, NaN)
@test minmax(NaN, NaN) (NaN, NaN)
@test min(-0.0,0.0) === min(0.0,-0.0)
@test max(-0.0,0.0) === max(0.0,-0.0)
@test minmax(-0.0,0.0) === minmax(0.0,-0.0)
@test max(-3.2, 5.1) == max(5.1, -3.2) == 5.1
@test min(-3.2, 5.1) == min(5.1, -3.2) == -3.2
@test max(-3.2, Inf) == max(Inf, -3.2) == Inf
@test max(-3.2, NaN) max(NaN, -3.2) NaN
@test max(-3.2, NaN) max(NaN, -3.2) NaN
@test min(5.1, Inf) == min(Inf, 5.1) == 5.1
@test min(5.1, -Inf) == min(-Inf, 5.1) == -Inf
@test min(5.1, NaN) min(NaN, 5.1) NaN
@test min(5.1, -NaN) min(-NaN, 5.1) NaN
@test min(5.1, NaN) min(NaN, 5.1) NaN
@test min(5.1, -NaN) min(-NaN, 5.1) NaN
@test minmax(-3.2, 5.1) == (min(-3.2, 5.1), max(-3.2, 5.1))
@test minmax(-3.2, Inf) == (min(-3.2, Inf), max(-3.2, Inf))
@test minmax(-3.2, NaN) (min(-3.2, NaN), max(-3.2, NaN))
@test (max(Inf,NaN), max(-Inf,NaN), max(Inf,-NaN), max(-Inf,-NaN)) (NaN,NaN,NaN,NaN)
@test (max(NaN,Inf), max(NaN,-Inf), max(-NaN,Inf), max(-NaN,-Inf)) (NaN,NaN,NaN,NaN)
@test (min(Inf,NaN), min(-Inf,NaN), min(Inf,-NaN), min(-Inf,-NaN)) (NaN,NaN,NaN,NaN)
@test (min(NaN,Inf), min(NaN,-Inf), min(-NaN,Inf), min(-NaN,-Inf)) (NaN,NaN,NaN,NaN)
@test minmax(-Inf,NaN) (min(-Inf,NaN), max(-Inf,NaN))
@test minmax(-3.2, NaN) (min(-3.2, NaN), max(-3.2, NaN))
@test (max(Inf,NaN), max(-Inf,NaN), max(Inf,-NaN), max(-Inf,-NaN)) (NaN,NaN,NaN,NaN)
@test (max(NaN,Inf), max(NaN,-Inf), max(-NaN,Inf), max(-NaN,-Inf)) (NaN,NaN,NaN,NaN)
@test (min(Inf,NaN), min(-Inf,NaN), min(Inf,-NaN), min(-Inf,-NaN)) (NaN,NaN,NaN,NaN)
@test (min(NaN,Inf), min(NaN,-Inf), min(-NaN,Inf), min(-NaN,-Inf)) (NaN,NaN,NaN,NaN)
@test minmax(-Inf,NaN) (min(-Inf,NaN), max(-Inf,NaN))

# fma
let x = Int64(7)^7
Expand Down