Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1726 from mdboom/affine_transform_math

stackplot_test_baseline has different results on 32-bit and 64-bit platforms
  • Loading branch information...
commit a4e4c682b8b8ef0f46fe8fe49d36a847433b8c0f 2 parents 293293f + 488e6a2
@mdboom mdboom authored
Showing with 12 additions and 2 deletions.
  1. +12 −2 src/_path.cpp
View
14 src/_path.cpp
@@ -1159,14 +1159,24 @@ _path_module::affine_transform(const Py::Tuple& args)
size_t stride1 = PyArray_STRIDE(vertices, 1);
double x;
double y;
+ volatile double t0;
+ volatile double t1;
+ volatile double t;
for (size_t i = 0; i < n; ++i)
{
x = *(double*)(vertex_in);
y = *(double*)(vertex_in + stride1);
- *vertex_out++ = a * x + c * y + e;
- *vertex_out++ = b * x + d * y + f;
+ t0 = a * x;
+ t1 = c * y;
+ t = t0 + t1 + e;
+ *(vertex_out++) = t;
+
+ t0 = b * x;
+ t1 = d * y;
+ t = t0 + t1 + f;
+ *(vertex_out++) = t;
vertex_in += stride0;
}
Please sign in to comment.
Something went wrong with that request. Please try again.