Echelon Neuron C Uživatelský manuál Strana 148

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 267
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 147
128 Functions
value = reverse(value);
// now value is 0xC7
}
rotate_long_left( ) Function
The rotate_long_left( ) function returns the bit-rotated value of
arg
. The bit
positions are rotated the number of places determined by the
count
argument.
The signedness of the argument does not affect the result. Bits that are rotated
out from the upper end of the value are rotated back in at the lower end. See also
rotate_long_right( ), rotate_short_left( ), and rotate_short_right( ).
Syntax
#include <byte.h>
long rotate_long_left (long
arg
, unsigned
count
);
Example
#include <byte.h>
void f(void)
{
long k;
k = 0x3F00;
k = rotate_long_left(k, 3);
// k now contains 0xF801
}
rotate_long_right( ) Function
The rotate_long_right( ) function returns the bit-rotated value of
arg
. The bit
positions are rotated the number of places determined by the
count
argument.
The signedness of the argument does not affect the result. Bits that are rotated
out from the lower end of the value are rotated back in at the upper end. See also
rotate_long_left( ), rotate_short_left( ), and rotate_short_right( ).
Syntax
#include <byte.h>
long rotate_long_right (long
arg
, unsigned
count
);
Example
#include <byte.h>
void f(void)
{
long k;
k = 0x3F04;
k = rotate_long_right(k, 3);
Zobrazit stránku 147
1 2 ... 143 144 145 146 147 148 149 150 151 152 153 ... 266 267

Komentáře k této Příručce

Žádné komentáře