~centralelyon2010/inkscape/imagelinks2

« back to all changes in this revision

Viewing changes to src/util/mathfns.h

  • Committer: JazzyNico
  • Date: 2011-08-29 20:25:30 UTC
  • Revision ID: nicoduf@yahoo.fr-20110829202530-6deuoz11q90usldv
Code refactoring and merging with trunk (revision 10599).

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
 * If c1==0 (and c0 is finite), then returns +/-inf.  This makes grid spacing of zero
49
49
 * mean "ignore the grid in this dimension".
50
50
 */
51
 
inline double round_to_lower_multiple_plus(double x, double const c1, double const c0)
 
51
inline double round_to_lower_multiple_plus(double x, double const c1, double const c0 = 0)
52
52
{
53
53
    return floor((x - c0) / c1) * c1 + c0;
54
54
}
60
60
 * If c1==0 (and c0 is finite), then returns +/-inf.  This makes grid spacing of zero
61
61
 * mean "ignore the grid in this dimension".
62
62
 */
63
 
inline double round_to_upper_multiple_plus(double x, double const c1, double const c0)
 
63
inline double round_to_upper_multiple_plus(double x, double const c1, double const c0 = 0)
64
64
{
65
65
    return ceil((x - c0) / c1) * c1 + c0;
66
66
}
80
80
  fill-column:99
81
81
  End:
82
82
*/
83
 
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
 
83
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :