diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2018-04-03 10:21:15 +0000 |
|---|---|---|
| committer | Tavmjong Bah <tavmjong@free.fr> | 2018-04-03 10:21:15 +0000 |
| commit | 715b5f5b45e6bb81651ecc4e5cffdd0d7b484f5a (patch) | |
| tree | a9ff806045b2ae5c2012797fbd444c4bd6a003e9 /src/decimal-round.h | |
| parent | Add new directory for 'manipulations' with README. (diff) | |
| download | inkscape-715b5f5b45e6bb81651ecc4e5cffdd0d7b484f5a.tar.gz inkscape-715b5f5b45e6bb81651ecc4e5cffdd0d7b484f5a.zip | |
Code cleanup: remove unneeded file.
Diffstat (limited to 'src/decimal-round.h')
| -rw-r--r-- | src/decimal-round.h | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/decimal-round.h b/src/decimal-round.h deleted file mode 100644 index b90958cae..000000000 --- a/src/decimal-round.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef SEEN_DECIMAL_ROUND_H -#define SEEN_DECIMAL_ROUND_H - -#include <cmath> - -namespace Inkscape { - -/** Returns x rounded to the nearest \a nplaces decimal places. - - Implemented in terms of std::round, i.e. we make no guarantees as to what happens if x is - half way between two rounded numbers. Add a note to the documentation if you care which - candidate is chosen for such case (round towards -infinity, +infinity, 0, or "even"). - - Note: nplaces is the number of decimal places without using scientific (e) notation, not the - number of significant figures. This function may not be suitable for values of x whose - magnitude is so far from 1 that one would want to use scientific (e) notation. - - The current implementation happens to allow nplaces to be negative: e.g. nplaces=-2 means - rounding to a multiple of 100. May or may not be useful. -**/ -inline double -decimal_round(double const x, int const nplaces) -{ - double const multiplier = std::pow(10.0, nplaces); - return round( x * multiplier ) / multiplier; -} - -} - -#endif /* !SEEN_DECIMAL_ROUND_H */ - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : |
