xref: /openbsd-src/lib/libm/arch/hppa/s_rint.c (revision d13be5d47e4149db2549a9828e244d59dbc43f15)
1 /*
2  * Written by Michael Shalayeff. Public Domain
3  */
4 
5 /* LINTLIBRARY */
6 
7 #include <sys/cdefs.h>
8 #include <float.h>
9 #include <math.h>
10 
11 double
12 rint(double x)
13 {
14 	__asm__ __volatile__("frnd,dbl %0,%0" : "+f" (x));
15 
16 	return (x);
17 }
18 
19 #ifdef	lint
20 /* PROTOLIB1 */
21 long double rintl(long double);
22 #else	/* lint */
23 __weak_alias(rintl, rint);
24 #endif	/* lint */
25