Sigrid Solveig Haflínudóttirbuild & install as syslibs396ff355 years agoHistory
33 lines · 461 B · C
RawDownload
#include <math.h> /* taken from musl */ #define dbleps 2.2204460492503131e-16 static double toint = 1.0/dbleps; doubleround(double x){	union {double f; u64int i;} u = {x};	int e = u.i >> 52 & 0x7ff;	double y; 	if(e >= 0x3ff+52)		return x;	if(u.i >> 63)		x = -x;	if(e < 0x3ff-1)		return 0*u.f;	y = x + toint - toint - x;	if(y > 0.5)		y = y + x - 1;	else if(y <= -0.5)		y = y + x + 1;	else		y = y + x;	if(u.i >> 63)		y = -y; 	return y;}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t