How to add / subtract / multiply and split integers using only 20 bits instead of 32 bits in C #?
Will these operations be faster than 32-bit precision?
For example, this .NET library has 20 and 30-bit arithmetic at different speeds: http://complex-a5.ru/polyboolean/index.html
Thank.
The processors have arithmetic units , so it is very fast to perform operations with 32-bit numbers. This is faster than any code you can write because it is “connected” to the processor.
20- (.. mod 2 ^ 20).
// , 20 32 #?
, 12 32- ints:
int twentyBitSum = (a + b) & 0xFFFFF;
, 32- ?
. , , - .
, , , , 32- , .
, , , 32- , , .
Source: https://habr.com/ru/post/1760891/More articles:Как я могу изменить сопоставления элементов управления/опции/командной строки в раскладке клавиатуры IntelliJ Emacs? - intellij-idealayer.zPosition does not work with non-sister UIViews - iphonefor each version of GCC and GCC - c ++sorting a list of tuples - pythonКак искать пользовательский начальный тег, используя Jericho в Java? - javaWhat is the difference between UITouch and UIGestureRecognizer? - iphoneHow to get the model queue name for a given dynamic queue (WebSphere MQ)? - ibm-mqПринудительная табуляция на скрытом элементе? Возможное? - javascriptAdmin site automatically gets current user - pythonСоздание карты с использованием двух массивов - c++All Articles