CARM User's Guide

Discontinued

ldiv_t

The ldiv_t type is defined in stdlib.h. It specifies the return type of the ldiv library routine. It is defined as:

typedef struct _ldiv_t {
        long rem;
        long quot;
} ldiv_t;

and is used as shown in the following example:

#include <stdlib.h>

void func (void) {
  ldiv_t lres;

  lres = ldiv(3456L, 2345L);              // Do division
  if (lres.rem >= 2345L/2L) lres.quot++;  // Round off
}