Keil Logo

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
}
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.