Borland C++ reference

_lrotl

raw OCR

Rotates an unsigned long integer value to the left.

Defined in header <stdlib.h>

Syntax

#include <stdlib.h>
unsigned  long _lrotl(unsigned long val, int count);

Portability

DOSUNIXWindowsANSI CC++ only
■■

Remarks

JrotI rotates the given val to the left count bits; val is an unsigned long.

Retum Value

_lrotl returns the value of val left-rotated co//nf bits.

See also

Example

#include <stdlib.h>
#include <stdio.h>

/* function prototypes */
int lrotl_example(void) ;
int lrotr_example(void);

/* Irotl example */
int lrotl_example(void)
{
   unsigned long result;
   unsigned long value = 100;

   result = _lrotl(value,1);
   printf("The value %lu rotated left"
          " one bit is: %lu\n", value, result);
   return 0;
/* Irotr example */
int lrotr_example{void)
{
   unsigned long result;
   unsigned long value = 100;

   result = _lrotr(value,1);
   printfC'The value %lu rotated right"
          " one bit is: %lu\n", value, result)
   return 0;
}
int main(void)
{
   lrotl_example();
   lrotr_example();
   return 0;

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.

Extraction notes

  • heading `IrotI` read as `_lrotl`