We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0443d7f + b6c39e1 commit 5b92405Copy full SHA for 5b92405
src/eval.cpp
@@ -31,7 +31,14 @@ namespace Sass {
31
inline double sub(double x, double y) { return x - y; }
32
inline double mul(double x, double y) { return x * y; }
33
inline double div(double x, double y) { return x / y; } // x/0 checked by caller
34
- inline double mod(double x, double y) { return std::abs(std::fmod(x, y)); } // x/0 checked by caller
+ inline double mod(double x, double y) { // x/0 checked by caller
35
+ if ((x > 0 && y < 0) || (x < 0 && y > 0)) {
36
+ double ret = std::fmod(x, y);
37
+ return ret ? ret + y : ret;
38
+ } else {
39
+ return std::fmod(x, y);
40
+ }
41
42
typedef double (*bop)(double, double);
43
bop ops[Sass_OP::NUM_OPS] = {
44
0, 0, // and, or
0 commit comments