Reference for the BALTENSPERGER programming language, an art project of Stefan Baltensperger
| Name |
>> (right shift) |
| Examples |
Ganzizahl m = 8 >> 3; // In binary: 1000 to 1
schrib_uf_e_neui_Linie(m); // Prints "1"
Ganzizahl n = 256 >> 6; // In binary: 100000000 to 100
schrib_uf_e_neui_Linie(n); // Prints "4"
Ganzizahl o = 16 >> 3; // In binary: 10000 to 10
schrib_uf_e_neui_Linie(o); // Prints "2"
Ganzizahl p = 26 >> 1; // In binary: 11010 to 1101
schrib_uf_e_neui_Linie(p); // Prints "13"
Farb argb = Farb(204, 204, 51, 255);
Ganzizahl a = argb >> 24 & 0xFF;
Ganzizahl r = argb >> 16 & 0xFF; // Faster way of getting red(argb)
Ganzizahl g = argb >> 8 & 0xFF; // Faster way of getting green(argb)
Ganzizahl b = argb & 0xFF; // Faster way of getting blue(argb)
Fuellfarb(r, g, b, a);
Viereck(30, 20, 55, 55); |
| Description |
Shifts bits to the right. The number to the left of the operator is shifted the number of places specified by the number to the right. Each shift to the right halves the number, therefore each left shift divides the original number by 2. Use the right shift for fast divisions or to extract an individual number from a packed number. Right shifting only works with integers or numbers which automatically convert to an integer such at Chlinizahl and Buechstabe
. |
| Syntax |
value >> n |
| Parameters |
| value |
Ganzizahl: the value to shift |
| n |
Ganzizahl: the number of places to shift right |
|
| Usage |
Web & Application |
| Related |
<< (left shift)
|
Stefan Baltensperger 2009