mirror of
https://github.com/fluencelabs/musl
synced 2025-07-01 15:42:05 +00:00
faster lrint and llrint functions
A faster workaround for spurious inexact exceptions when the result cannot be represented. The old code actually could be wrong, because gcc reordered the integer conversion and the exception check.
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
#define type double
|
||||
#define roundit rint
|
||||
#define dtype long long
|
||||
#define fn llrint
|
||||
|
||||
#include "lrint.c"
|
||||
#include <math.h>
|
||||
|
||||
/* assumes LLONG_MAX > 2^53, see comments in lrint.c */
|
||||
|
||||
long long llrint(double x)
|
||||
{
|
||||
return rint(x);
|
||||
}
|
||||
|
Reference in New Issue
Block a user