History

src/common.h : Add static inline function fmod_one.

Erik de Castro Lopo committed 19 years ago

Commit 44797741 parent ece584a1 file · +17 −9Browse files

Unified · Split

src/common.h+17−9
@@ -1,5 +1,5 @@
11 /*
2−** Copyright (C) 2002-2006 Erik de Castro Lopo <erikd@mega-nerd.com>
2+** Copyright (C) 2002-2007 Erik de Castro Lopo <erikd@mega-nerd.com>
33 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
@@ -129,13 +129,21 @@ const char* zoh_get_description (int src_enum) ; · 123 unmodified lines
129129
130130 int zoh_set_converter (SRC_PRIVATE *psrc, int src_enum) ;
131131
132−#endif /* COMMON_H_INCLUDED */
133−
134−/*
135−** Do not edit or modify anything in this comment block.
136−** The arch-tag line is a file identity tag for the GNU Arch
137−** revision control system.
138−**
139−** arch-tag: 737d46dc-a2f8-4025-bb88-fc8915c69085
132+/*----------------------------------------------------------
133+** Common static inline functions.
140134 */
141135
136+static inline double
137+fmod_one (double x)
138+{ double y = 1.0 ;
139+ double i, f ;
140+
141+ i = floor (x / y) ;
142+ f = x - i * y ;
143+ if ((x < 0.0) != (y < 0.0))
144+ f = f - y ;
145+ return f ;
146+} /* fmod_one */
147+
148+#endif /* COMMON_H_INCLUDED */
149+

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