Re: [swift-users] what's ^ operator for

2016-09-18 Thread Saagar Jha via swift-users
The ^ operator performs a bitwise XOR 
. This is not the same as 
exponentiation.

Saagar Jha



> On Sep 18, 2016, at 05:41, Mr Bee via swift-users  
> wrote:
> 
> Hi all,
>  
> I wrote this in XCode Playground…
> 
> let i = 2^2
> print(i)
> 
> 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.
> 
> Regards,
> 
> –Mr Bee
> 
> ___
> swift-users mailing list
> swift-users@swift.org
> https://lists.swift.org/mailman/listinfo/swift-users

___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


[swift-users] what's ^ operator for

2016-09-18 Thread Mr Bee via swift-users
Hi all, I wrote this in XCode Playground…
let i = 2^2print(i)
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.
Regards,
–Mr Bee
___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users