ROSE/dosfs/div.c

16 lines
296 B
C
Raw Normal View History

2024-08-09 12:34:46 -05:00
#pragma once
#include <stdint.h>
/* STDLIB DIV FUNCTIONS */
typedef struct { int32_t quot, rem; } div_t;
typedef struct { int64_t quot, rem; } ldiv_t;
div_t div(int num, int den)
{
return (div_t){ num/den, num%den };
}
ldiv_t ldiv(long num, long den)
{
return (ldiv_t){ num/den, num%den };
}