summaryrefslogtreecommitdiffstats
path: root/lib/libm/arch/hppa/s_rint.c
blob: 1f06be47f36597ec647d19d5a6a74944b822b4f6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * Written by Michael Shalayeff. Public Domain
 */

#if defined(LIBM_SCCS) && !defined(lint)
static char rcsid[] = "$OpenBSD: s_rint.c,v 1.3 2008/12/09 20:00:35 martynas Exp $";
#endif

#include <machine/cdefs.h>
#include <float.h>
#include <math.h>

double
rint(double x)
{
	__asm__ __volatile__("frnd,dbl %0,%0" : "+f" (x));

	return (x);
}

#if LDBL_MANT_DIG == 53
#ifdef __weak_alias   
__weak_alias(rintl, rint);
#endif /* __weak_alias */
#endif /* LDBL_MANT_DIG == 53 */