[swift-users] what's ^ operator for
saagar at saagarjha.com
Sun Sep 18 19:30:49 CDT 2016
The ^ operator performs a bitwise XOR <https://en.wikipedia.org/wiki/Bitwise_operation#XOR>. This is not the same as exponentiation.
> On Sep 18, 2016, at 05:41, Mr Bee via swift-users <swift-users at swift.org> wrote:
> Hi all,
> I wrote this in XCode Playground…
> let i = 2^2
> It runs fine without any errors and print 0, while I expect it to print 4 from 2 power by 2 or 2². Swift ebook and even Google gave me nothing on this.
> What did I miss?
> Thank you.
> –Mr Bee
> swift-users mailing list
> swift-users at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-users