summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
29653ad)
rint() and nearbyint() are identical except that nearbyint() will not
raise the inexact result exception, which we don't care about. OpenBSD
and probably other OSes have rint() but not nearbyint().
Perhaps a better fix would be to add a nearbyint module to Gnulib.
/* PSPPIRE - a graphical user interface for PSPP.
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2008, 2009 Free Software Foundation
+ Copyright (C) 2008, 2009, 2010 Free Software Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
fraction = (unit - start) / (gdouble) tower_node_get_size (&an->unit_node);
return tower_node_get_level (&an->pixel_node) +
fraction = (unit - start) / (gdouble) tower_node_get_size (&an->unit_node);
return tower_node_get_level (&an->pixel_node) +
- nearbyint (fraction * tower_node_get_size (&an->pixel_node));
+ rint (fraction * tower_node_get_size (&an->pixel_node));
an = tower_data (n, struct axis_node, unit_node);
an = tower_data (n, struct axis_node, unit_node);
- return nearbyint (tower_node_get_size (&an->pixel_node)
- / (gdouble) tower_node_get_size (&an->unit_node));
+ return rint (tower_node_get_size (&an->pixel_node)
+ / (gdouble) tower_node_get_size (&an->unit_node));
tower_resize (&a->unit_tower, &existing_node->unit_node, posn - start);
tower_resize (&a->pixel_tower, &existing_node->pixel_node,
tower_resize (&a->unit_tower, &existing_node->unit_node, posn - start);
tower_resize (&a->pixel_tower, &existing_node->pixel_node,
- nearbyintf (fraction * existing_pixel_size));
+ rintf (fraction * existing_pixel_size));
tower_insert (&a->unit_tower,
existing_unit_size - (posn - start),
tower_insert (&a->unit_tower,
existing_unit_size - (posn - start),
tower_insert (&a->pixel_tower,
tower_insert (&a->pixel_tower,
- nearbyintf (existing_pixel_size * (1 - fraction)),
+ rintf (existing_pixel_size * (1 - fraction)),
&new_node->pixel_node,
tower_next (&a->pixel_tower, &existing_node->pixel_node));
}
&new_node->pixel_node,
tower_next (&a->pixel_tower, &existing_node->pixel_node));
}