# Bitwise not (~) do noting on windows64

**URL:** <https://discourse.julialang.org/t/bitwise-not-do-noting-on-windows64/3542>\
**Category:** Numerics\
**Tags:** question\
**Created:** [May 5, 2017, 4:10pm UTC](https://discourse.julialang.org/t/bitwise-not-do-noting-on-windows64/3542 "2017-05-05T16:10:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![7akase](https://avatars.discourse-cdn.com/v4/letter/7/dc4da7/32.png) [@7akase](https://discourse.julialang.org/u/7akase)\
**Post date:** [May 5, 2017, 4:10pm UTC](https://discourse.julialang.org/t/bitwise-not-do-noting-on-windows64/3542/1 "2017-05-05T16:10:38Z")

</div>

Hi.  
I tried bitwise not operator (~) and get the unchanged result

> ~123 #=\> 123  
> while -124 is expected according to the document.  
> I uses v0.5.0 on windows64.

Could anyone tell me the proper way to use this operator ?

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [May 5, 2017, 4:40pm UTC](https://discourse.julialang.org/t/bitwise-not-do-noting-on-windows64/3542/2 "2017-05-05T16:40:42Z")

</div>

```julia
julia> Sys.KERNEL
:NT

julia> VERSION
v"0.5.1"

julia> ~123
-124

```

I’m getting the same result for 0.5.0 too, so maybe you rebound `~` to something else by accident? Can you reproduce this if you start a new REPL session?

---

<div class="post-metadata">

**Author:** ![7akase](https://avatars.discourse-cdn.com/v4/letter/7/dc4da7/32.png) [@7akase](https://discourse.julialang.org/u/7akase)\
**Post date:** [May 6, 2017, 12:28am UTC](https://discourse.julialang.org/t/bitwise-not-do-noting-on-windows64/3542/3 "2017-05-06T00:28:39Z")

</div>

There is no problem on a new REPL.  
Checking the command history, I found this typo :

> julia\> ~=typeof(123)

Apparently this line caused my problem.

Thank you !

---

<div class="post-metadata">

**Author:** ![Stephen\_Vavasis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stephen_vavasis/32/3389_2.png) [@Stephen\_Vavasis](https://discourse.julialang.org/u/Stephen_Vavasis)\
**Post date:** [May 6, 2017, 3:46am UTC](https://discourse.julialang.org/t/bitwise-not-do-noting-on-windows64/3542/4 "2017-05-06T03:46:44Z")

</div>

I’ve brought this up before, but I suppose it is worth repeating-- it is far too easy in Julia to accidentally redefine Base operators, and these redefinitions can have baffling and insidious effects. Could the language be revised slightly so that redefinition of an operator requires some more obvious block of code? For example, instead of `+ = 7`, maybe

```julia
   Base.+ = 7

```

The core developers need to have pity on the future grad students who will be lab assistants in courses that will use Julia.

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [May 6, 2017, 4:33am UTC](https://discourse.julialang.org/t/bitwise-not-do-noting-on-windows64/3542/5 "2017-05-06T04:33:56Z")

</div>

FWIW `+ = 7` does absolutely nothing with `Base`.

---

<div class="post-metadata">

**Author:** ![fengyang.wang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fengyang.wang/32/104_2.png) [@fengyang.wang](https://discourse.julialang.org/u/fengyang.wang)\
**Post date:** [May 6, 2017, 5:34am UTC](https://discourse.julialang.org/t/bitwise-not-do-noting-on-windows64/3542/6 "2017-05-06T05:34:39Z")

</div>

As @yuyichao mentioned, there is a difference between shadowing and overriding. You can’t accidentally override `Base` operators without being explicit somewhere.
