Skip to content

Commit

Permalink
faster iszero(::Bool) (#20437)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj authored and ararslan committed Feb 4, 2017
1 parent 1eb955a commit 23f2cd3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions base/bool.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ signbit(x::Bool) = false
sign(x::Bool) = x
abs(x::Bool) = x
abs2(x::Bool) = x
iszero(x::Bool) = !x

<(x::Bool, y::Bool) = y&!x
<=(x::Bool, y::Bool) = y|!x
Expand Down
2 changes: 2 additions & 0 deletions test/numbers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ const ≣ = isequal # convenient for comparing NaNs
@test Bool(1//1) == true
@test_throws InexactError Bool(1//2)

@test iszero(false) && !iszero(true)

# basic arithmetic
@test 2 + 3 == 5
@test 2.0 + 3.0 == 5.
Expand Down

2 comments on commit 23f2cd3

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something went wrong when running your job:

NanosoldierError: failed to run benchmarks against primary commit: ErrorException("failed process: Process(`sudo cset shield -e su nanosoldier -- -c ./benchscript.sh`, ProcessExited(1)) [1]")

Logs and partial data can be found here
cc @jrevels

Please sign in to comment.