# Negative false no longer acts as a strong zero

**URL:** https://discourse.julialang.org/t/negative-false-no-longer-acts-as-a-strong-zero/128506
**Category:** General Usage
**Created:** [April 28, 2025, 11:35pm UTC](https://discourse.julialang.org/t/negative-false-no-longer-acts-as-a-strong-zero/128506 "2025-04-28T23:35:48Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![lance\_xwq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lance_xwq/32/36647_2.png) [@lance\_xwq](https://discourse.julialang.org/u/lance_xwq)
#### Post date: [April 28, 2025, 11:35pm UTC](https://discourse.julialang.org/t/negative-false-no-longer-acts-as-a-strong-zero/128506/1 "2025-04-28T23:35:48Z")

</div>

[Julia documentation](https://docs.julialang.org/en/v1/manual/mathematical-operations/#Arithmetic-Operators) states that `false` acts like a strong zero in multiplication, such that `NaN * false` produces `0.0`. However, [Julia also defines](https://github.com/JuliaLang/julia/blob/59e9ada533850a0c15850644c1936d253aa2d8e7/base/bool.jl#L166) `-(x::Bool) = -Int(x)`, which seems to indicate `-false` is no longer a strong zero.

Personally, I find it a bit confusing, as:

```julia
julia> -NaN * false
-0.0

julia> NaN * -false
NaN

```

and

```julia
julia> 1 - NaN * false
1.0

julia> 1 - false * NaN
1.0

julia> - false * NaN + 1
NaN

julia> - NaN * false + 1
1.0

```

IMHO, this behavior may lead to some inconsistency and unpredictability. For example, as mentioned in [`rmul!` does not respect "strong zero": `NaN*false=0.0` · Issue #2607 · JuliaGPU/CUDA.jl · GitHub](https://github.com/JuliaGPU/CUDA.jl/issues/2607#issuecomment-2573015555),

```julia
julia> using LinearAlgebra

julia> rotate!([NaN], [NaN], false, false) # rotate!(x, y, c, s) means: x = c*x + s*y and y = -conj(s)*x + c*y
([0.0], [NaN])

```

---

_[View the full topic](https://discourse.julialang.org/t/negative-false-no-longer-acts-as-a-strong-zero/128506)._
