ReFran Posted January 18, 2012 Posted January 18, 2012 Hi, I need to translate a js example with bitshift left/right. JS-Script: var y = (((1 << 14) >> 1) - 1 - 5446); WScript.echo(y); the result is 2745. Thanks in advance Reinhard
Blue_Drache Posted January 18, 2012 Posted January 18, 2012 BitShift() doesn't work for you? (hint ... click the name of the function) Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache
Moderators JLogan3o13 Posted January 18, 2012 Moderators Posted January 18, 2012 Try this: $x = BitShift(BitShift(1, -14), 1) -1 -5446 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
UEZ Posted January 18, 2012 Posted January 18, 2012 Try this: #cs JS-Script: var y = (((1 << 14) >> 1) - 1 - 5446); WScript.echo(y); the result is 2745. #ce $y = BitShift(BitShift(1, -14), 1) - 1 - 5446 MsgBox(0, "Bitshit", $y) Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
Moderators JLogan3o13 Posted January 18, 2012 Moderators Posted January 18, 2012 Ok, so I used $x instead of $y "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
UEZ Posted January 18, 2012 Posted January 18, 2012 @JLogan3o13: indeed, I did the same thing as you already did...didn't saw your post! Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
ReFran Posted January 18, 2012 Author Posted January 18, 2012 (edited) @BlueDrache... (hint ... click the name of the function)I did try that, but didn't got the right result.@JLogan3o13Many thanks for your help. I searched now tor 3 days how I can show a Yahoo map using Googles Map Api (the zoom factor and the y coord somewho revers). Finaly I found a phyton script which I translated - with some problems - to JS (for use in a html page). Now I want to use it also for my au3 map download tool. I tried already "$n = Bitshift(Bitshift(14,1),-1) -1 -5446", but didn't work correctly. So I thought before I spent further 3 day on a solution, here may be one who can solve it quicker.So thank you very much for saving time and more endless testing. Works pefect.@UEZThanks for confirmation.You are right I will take Y because it's the Y coord ;-)best regards, Reinhard Edited January 18, 2012 by ReFran
Malkey Posted January 18, 2012 Posted January 18, 2012 A simplification (or anti-obscuration) of BitShift(BitShift(1, -14), 1) - 1 - 5446 is BitShift(1, -13) - 5447 ConsoleWrite(BitShift(BitShift(1, -14), 1) - 1 - 5446 & @LF) ; BitShift(BitShift(1, -14), 1) - 1 - 5446 = BitShift(1, -13) - 5447 ConsoleWrite(BitShift(1, -13) - 5447 & @LF) #cs @ output console:- 2745 2745 #ce
Blue_Drache Posted January 18, 2012 Posted January 18, 2012 Try this: #cs JS-Script: var y = (((1 << 14) >> 1) - 1 - 5446); WScript.echo(y); the result is 2745. #ce $y = BitShift(BitShift(1, -14), 1) - 1 - 5446 MsgBox(0, "Bitshit", $y) Br, UEZ Lol. "MsgBox(0,"Bitshit",$y)" ... nice typo. AdmiralAlkex 1 Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache
UEZ Posted January 18, 2012 Posted January 18, 2012 That wasn't a typo... Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now