cinap_lenrekadd hg and python4bb9e2215 years agoHistory
27 lines · 435 B · C
RawDownload
 /* Portable fmod(x, y) implementation for systems that don't have it */ #include "pyconfig.h" #include "pyport.h"#include <errno.h> doublefmod(double x, double y){	double i, f;		if (y == 0.0) {		errno = EDOM;		return 0.0;	}		/* return f such that x = i*y + f for some integer i	   such that |f| < |y| and f has the same sign as x */		i = floor(x/y);	f = x - i*y;	if ((x < 0.0) != (y < 0.0))		f = f-y;	return f;}

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