| Index: runtime/vm/code_generator.cc
|
| ===================================================================
|
| --- runtime/vm/code_generator.cc (revision 17850)
|
| +++ runtime/vm/code_generator.cc (working copy)
|
| @@ -1717,4 +1717,20 @@
|
| }
|
| END_LEAF_RUNTIME_ENTRY
|
|
|
| +
|
| +double DartModulo(double left, double right) {
|
| + double remainder = fmod_ieee(left, right);
|
| + if (remainder == 0.0) {
|
| + // We explicitely switch to the positive 0.0 (just in case it was negative).
|
| + remainder = +0.0;
|
| + } else if (remainder < 0.0) {
|
| + if (right < 0) {
|
| + remainder -= right;
|
| + } else {
|
| + remainder += right;
|
| + }
|
| + }
|
| + return remainder;
|
| +}
|
| +
|
| } // namespace dart
|
|
|