mailing list of musl libc
 help / color / mirror / code / Atom feed
701df948413693b0d0d79282a75381086d748644 blob 312 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
 
#include <fenv.h>
#include <limits.h>
#include <math.h>

/* uses LLONG_MAX > 2^53, see comments in lrint.c */

long long llrint(double x)
{
	if (isnan(x) || isinf(x)) {
		feraiseexcept(FE_INVALID);
		return x;
	}

	x = rint(x);
	if (x > LLONG_MAX || x < LLONG_MIN) {
		feraiseexcept(FE_INVALID);
	}
	return x;
}
debug log:

solving 701df94 ...
found 701df94 in https://inbox.vuxu.org/musl/20140911073532.GA3179@zx-spectrum/
found 4f583ae in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 4f583ae5536aa6152c3bab8671846da507f8f57e	src/math/llrint.c

applying [1/1] https://inbox.vuxu.org/musl/20140911073532.GA3179@zx-spectrum/
diff --git a/src/math/llrint.c b/src/math/llrint.c
index 4f583ae..701df94 100644

Checking patch src/math/llrint.c...
Applied patch src/math/llrint.c cleanly.

index at:
100644 701df948413693b0d0d79282a75381086d748644	src/math/llrint.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).