Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion libs/libm/libm/lib_truncl.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,20 @@
****************************************************************************/

#ifdef CONFIG_HAVE_LONG_DOUBLE
#if LDBL_MANT_DIG == DBL_MANT_DIG

/* Cover case when double is the same as long double (64 bit ieee754). */

long double truncl(long double x)
{
return trunc(x);
}

#else

static const long double toint = 1 / LDBL_EPSILON;

/* FIXME This will only work if long double is 64 bit and little endian */
/* FIXME This will only work if long double is 80 bit and little endian */

union ldshape
{
Expand Down Expand Up @@ -101,3 +112,4 @@ long double truncl(long double x)
return s ? -x : x;
}
#endif
#endif
Loading