Does a lot of work towards the PIT
Added a math library, with clamp and POW. added printf support for printing doubles added a few helper functions in PIT for calcaulting the time in seconds of a clock cycle based on divisor
This commit is contained in:
13
libc/include/math.h
Normal file
13
libc/include/math.h
Normal file
@ -0,0 +1,13 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef MATH_H
|
||||
#define MATH_H
|
||||
|
||||
int pow(int base, int exp);
|
||||
|
||||
uint8_t clamp_u8(uint8_t val, uint8_t min, uint8_t max);
|
||||
uint16_t clamp_u16(uint16_t val, uint16_t min, uint16_t max);
|
||||
uint32_t clamp_u32(uint32_t val, uint32_t min, uint32_t max);
|
||||
uint64_t clamp_u64(uint64_t val, uint64_t min, uint64_t max);
|
||||
|
||||
#endif
|
@ -20,5 +20,7 @@ char* u8toa(uint8_t num, char* buf, int base);
|
||||
char* itoa(int num, char* buf, int base);
|
||||
char* utoa(unsigned int num, char* buf, int base);
|
||||
|
||||
char* dtoa(double n, char* buf, int afterpoint);
|
||||
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user