![]() ![]() State = Bitwise.ShiftRight(state, 1) Or Bitwise.ShiftLeft(newbit, 63) TextArea1.VerticalScrollPosition = TextArea1.LineNumber() // Scroll to endĪpp.DoEvents // Don't do this in a real app!! TextArea1.AddText(Bitwise.BitAnd(state, 1).ToBinary(1)) Var state As UInt64 = Bitwise.ShiftLeft(1, 63) Or 1 Updated to use correct tap bits for 64-bit numbers (Oct 5, 2021) Var state As UInt64 = Bitwise.ShiftLeft(1, 63) Or 1 The Xojo code below ought to help you understand them better. If you’ve not used Python before, you might find all the symbols to be a bit cryptic. So we have to tweak the Python code to work with 64-bit integers, which are more commonly available and the maximum supported in Xojo. ![]() One thing about Python is that its integers are arbitrary precision unlike most other programming languages like Xojo, Java or C#. Here’s the original Python code: state = (1 > 1) ^ (state > 2) ^ (state > 7)) & 1 Pound uses Python for his example, so I thought I’d quickly convert it to Xojo. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |