+2003-07-27 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ * flower/libc-extension.cc (my_round): ANSI-C compatible rounding.
+
2003-07-27 Rune Zedeler <rz@daimi.au.dk>
* Documentation/user/refman.itely (Percussion): Small
Byte *strrev (Byte* byte, int length_i);
+double my_round (double);
+
#endif // LIBC_EXTENSION_HH
Jan Nieuwenhuizen <janneke@gnu.org>
*/
+#include <math.h>
+
#include <stdio.h>
#include <string.h>
#include <ctype.h>
return start;
}
+/*
+ There are some strange problems with round() on early glibcs.
+ */
+double
+my_round (double x)
+{
+ return floor (x -0.5)+ 1.0 ;
+}
#if !HAVE_ISINF
Real pos = Staff_symbol_referencer::get_position (g);
if (fabs (rint (pos) -pos) < 1e-6) // ugh.
- /*
- lrint has issues with various glibcs.
- */
- return gh_int2scm ((int) round (pos));
+ return gh_int2scm ((int) my_round (pos));
else
return gh_double2scm (pos);
}