bitwise not external?

    Sep 07 2011 | 11:53 am
    hi, noob question here.
    is there a bitwise NOT external for ints?
    (i know about bitnot~ for floats, but what about normal ints? and i know how to patch an abstraction, thank you very much)

    • Sep 07 2011 | 12:11 pm
      you can obtain it with [expr $i1 ^ -1] aa
    • Sep 07 2011 | 3:42 pm
      jasch==noob :)
    • Sep 07 2011 | 5:27 pm
      thanks andrea, that looks good. not the bitnot external i was hoping for, but close enough. altough expr also supports the "proper" bitnot operator ~
      this solution gives a 32bit result, since max ints are 32 bits in size. for my application i have to mask out the extra 16 bits since i'm actually working with shorts (16bits).
      my patch looks like this: value - [expr ~ $i1] - [& 65535] - bitnot-value
      and here's my abstraction: