MCPcopy Create free account
hub / github.com/N64Recomp/N64Recomp / DDIV

Function DDIV

include/recomp.h:73–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71#endif
72
73static inline void DDIV(int64_t a, int64_t b, int64_t* quot, int64_t* rem) {
74 int overflow = ((uint64_t)a == 0x8000000000000000ull) && (b == -1ll);
75 *quot = overflow ? a : (a / b);
76 *rem = overflow ? 0 : (a % b);
77}
78
79static inline void DDIVU(uint64_t a, uint64_t b, uint64_t* quot, uint64_t* rem) {
80 *quot = a / b;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected