From 8e793236948c5cc18e49e92cb736af3e72cb9010 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 26 Jan 2015 19:00:35 -0600 Subject: [PATCH] Add math library support for trunc functions. From Brennan Ashton. --- interpreters/micropython/micropython_main.c | 33 --------------------- 1 file changed, 33 deletions(-) diff --git a/interpreters/micropython/micropython_main.c b/interpreters/micropython/micropython_main.c index 24bb12edf..0d68e815b 100644 --- a/interpreters/micropython/micropython_main.c +++ b/interpreters/micropython/micropython_main.c @@ -149,39 +149,6 @@ float nanf(FAR const char *tagp) return 0; } -float truncf(float x) -{ - union - { - float f; - uint32_t i; - } u = - { - x}; - int e = (int)(u.i >> 23 & 0xff) - 0x7f + 9; - uint32_t m; - - if (e >= 23 + 9) - { - return x; - } - - if (e < 9) - { - e = 1; - } - - m = -1U >> e; - if ((u.i & m) == 0) - { - return x; - } - - FORCE_EVAL(x + 0x1p120f); - u.i &= ~m; - return u.f; -} - /**************************************************************************** * mp_import_stat ****************************************************************************/