Echelon Neuron C Manuel d'utilisateur Page 148

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 267
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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);
Vue de la page 147
1 2 ... 143 144 145 146 147 148 149 150 151 152 153 ... 266 267

Commentaires sur ces manuels

Pas de commentaire