Skip to content

Commit c198d93

Browse files
committed
add __ieee754 functions
1 parent 7927375 commit c198d93

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

hardware/esp8266com/esp8266/cores/esp8266/libc_replacements.c

+77
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#include <stddef.h>
2727
#include <stdarg.h>
28+
#include <math.h>
2829

2930
#include "ets_sys.h"
3031
#include "os_type.h"
@@ -311,3 +312,79 @@ int isblank(int c) {
311312

312313
// ##########################################################################
313314

315+
static int errno = 0;
316+
317+
int * __errno(void) {
318+
printf("__errno is called last error: %d (not current)\n", errno);
319+
return &errno;
320+
}
321+
322+
323+
// ##########################################################################
324+
// __ieee754 functions
325+
// ##########################################################################
326+
327+
double __ieee754_sinh(double x) {
328+
return sinh(x);
329+
}
330+
331+
double __ieee754_hypot(double x, double y) {
332+
return hypot(x, y);
333+
}
334+
335+
float __ieee754_hypotf(float x, float y) {
336+
return hypotf(x, y);
337+
}
338+
339+
float __ieee754_logf(float x) {
340+
return logf(x);
341+
}
342+
343+
double __ieee754_log10(double x) {
344+
return log10(x);
345+
}
346+
347+
double __ieee754_exp(double x) {
348+
return exp(x);
349+
}
350+
351+
double __ieee754_cosh(double x) {
352+
return cosh(x);
353+
}
354+
355+
float __ieee754_expf(float x) {
356+
return expf(x);
357+
}
358+
359+
float __ieee754_log10f(float x) {
360+
return log10f(x);
361+
}
362+
363+
double __ieee754_atan2(double x, double y) {
364+
return atan2(x, y);
365+
}
366+
367+
float __ieee754_sqrtf(float x) {
368+
return sqrtf(x);
369+
}
370+
371+
float __ieee754_sinhf(float x) {
372+
return sinhf(x);
373+
}
374+
375+
double __ieee754_log(double x) {
376+
return log(x);
377+
}
378+
379+
double __ieee754_sqrt(double x) {
380+
return sqrt(x);
381+
}
382+
383+
float __ieee754_coshf(float x) {
384+
return coshf(x);
385+
}
386+
387+
float __ieee754_atan2f(float x, float y) {
388+
return atan2f(x, y);
389+
}
390+

0 commit comments

Comments
 (0)