diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2015-01-26 19:00:35 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2015-01-26 19:00:35 -0600 |
commit | 6461f948f2f57e6d434c33ace44ea25e70d4c3fb (patch) | |
tree | 9f3652f661638307ee9db022e3a82b3df89a5c03 /apps/interpreters/micropython/micropython_main.c | |
parent | 75c95457ede503b3f383c3e2df41239981221c06 (diff) | |
download | nuttx-6461f948f2f57e6d434c33ace44ea25e70d4c3fb.tar.gz nuttx-6461f948f2f57e6d434c33ace44ea25e70d4c3fb.tar.bz2 nuttx-6461f948f2f57e6d434c33ace44ea25e70d4c3fb.zip |
Add math library support for trunc functions. From Brennan Ashton.
Diffstat (limited to 'apps/interpreters/micropython/micropython_main.c')
-rw-r--r-- | apps/interpreters/micropython/micropython_main.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/apps/interpreters/micropython/micropython_main.c b/apps/interpreters/micropython/micropython_main.c index 24bb12edf..0d68e815b 100644 --- a/apps/interpreters/micropython/micropython_main.c +++ b/apps/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 ****************************************************************************/ |