<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">The ^ operator performs a <a href="https://en.wikipedia.org/wiki/Bitwise_operation#XOR" class="">bitwise XOR</a>. This is not the same as exponentiation.<br class=""><div class="">
<br class="Apple-interchange-newline"><span style="color: rgb(0, 0, 0); font-family: 'SF UI Text'; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none;" class="">Saagar Jha</span><br style="color: rgb(0, 0, 0); font-family: 'SF UI Text'; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><br style="color: rgb(0, 0, 0); font-family: 'SF UI Text'; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><br style="color: rgb(0, 0, 0); font-family: 'SF UI Text'; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Sep 18, 2016, at 05:41, Mr Bee via swift-users <<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><div style="background-color: rgb(255, 255, 255); font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px;" class=""><div id="yui_3_16_0_1_1474202273150_2698" class=""><span class="">Hi all,</span></div><div class=""></div><div id="yui_3_16_0_1_1474202273150_2699" class=""> </div><div class="">I wrote this in XCode Playground…</div><div id="yui_3_16_0_1_1474202273150_2700" class=""><br class=""></div><div id="yui_3_16_0_1_1474202273150_2701" class="">let i = 2^2</div><div class="signature" id="yui_3_16_0_1_1474202273150_2471"><div id="yui_3_16_0_1_1474202273150_2470" class="">print(i)</div><div id="yui_3_16_0_1_1474202273150_2470" class=""><br class=""></div><div id="yui_3_16_0_1_1474202273150_2470" dir="ltr" class="">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.</div><div id="yui_3_16_0_1_1474202273150_2470" dir="ltr" class=""><br class=""></div><div id="yui_3_16_0_1_1474202273150_2470" dir="ltr" class="">What did I miss?</div><div id="yui_3_16_0_1_1474202273150_2470" dir="ltr" class=""><br class=""></div><div id="yui_3_16_0_1_1474202273150_2470" dir="ltr" class="">Thank you.</div><div id="yui_3_16_0_1_1474202273150_2470" dir="ltr" class=""><br class=""></div><div id="yui_3_16_0_1_1474202273150_2470" dir="ltr" class="">Regards,</div><div id="yui_3_16_0_1_1474202273150_2470" class=""><br class=""></div>–Mr Bee<div id="yui_3_16_0_1_1474202273150_2472" class=""><br class=""></div></div></div></div>_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-users<br class=""></div></blockquote></div><br class=""></body></html>