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:
@ -77,6 +77,18 @@ int printf(const char* restrict format, ...) {
|
||||
if (!print(buffer, len))
|
||||
return -1;
|
||||
written += len;
|
||||
} else if (*format == 'f') {
|
||||
format++;
|
||||
double d = (double) va_arg(parameters, double);
|
||||
dtoa(d, buffer, 5);
|
||||
size_t len = strlen(buffer);
|
||||
if (maxrem < len) {
|
||||
// TODO
|
||||
return -1;
|
||||
}
|
||||
if (!print(buffer, len))
|
||||
return -1;
|
||||
written += len;
|
||||
} else if (*format == 'u') {
|
||||
format++;
|
||||
unsigned int i = (unsigned int) va_arg(parameters, unsigned int);
|
||||
|
Reference in New Issue
Block a user