When computing a remainder and a quotient on an LPC chip, this might be the faster way:

```
typedef struct {
int quot;
int rem;
} IDIV_RETURN_T;
typedef struct {
unsigned quot;
unsigned rem;
} UIDIV_RETURN_T;
typedef struct {
int (*sidiv)(int numerator, int denominator); /*!< Signed integer division */
unsigned (*uidiv)(unsigned numerator, unsigned denominator); /*!< Unsigned integer division */
IDIV_RETURN_T (*sidivmod)(int numerator, int denominator); /*!< Signed integer division with remainder */
UIDIV_RETURN_T (*uidivmod)(unsigned numerator, unsigned denominator); /*!< Unsigned integer division
with remainder */
} ROM_DIV_API_T;
typedef struct {
const uint32_t usbdApiBase; /*!< USBD API function table base address */
const uint32_t reserved0;
/*!< Reserved */
const uint32_t reserved1;
/*!< Reserved */
const void *pPWRD; /*!< Power API function table base address */
const ROM_DIV_API_T *divApiBase; /*!< Divider API function table base address */
} LPC_ROM_API_T;
#define LPC_ROM_API_BASE_LOC (0x1FFF1FF8UL)
#define LPC_ROM_API (*(LPC_ROM_API_T * *) LPC_ROM_API_BASE_LOC)
```

Used like this:

```
const ROM_DIV_API_T *pROMDiv = LPC_ROM_API->divApiBase;
UIDIV_RETURN_T ret = pROMDiv->uidivmod( numerator, denominator );
```

`ret.quot`

will contain numerator / denominator, and `ret.rem`

will contain `numerator % denominator`

.