Commit 4c26a47c authored by Stefan Behnel's avatar Stefan Behnel Committed by GitHub

Merge pull request #2822 from cgohlke/patch-4

Fix msvc compiler warning C4244
parents a9345797 33e3b853
...@@ -188,13 +188,13 @@ static {{type}} __Pyx_PyComplex_As_{{type_name}}(PyObject* o) { ...@@ -188,13 +188,13 @@ static {{type}} __Pyx_PyComplex_As_{{type_name}}(PyObject* o) {
return {{type_name}}_from_parts(a.real / b.real, a.imag / b.imag); return {{type_name}}_from_parts(a.real / b.real, a.imag / b.imag);
} else { } else {
{{real_type}} r = b.imag / b.real; {{real_type}} r = b.imag / b.real;
{{real_type}} s = 1.0 / (b.real + b.imag * r); {{real_type}} s = ({{real_type}})(1.0) / (b.real + b.imag * r);
return {{type_name}}_from_parts( return {{type_name}}_from_parts(
(a.real + a.imag * r) * s, (a.imag - a.real * r) * s); (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
} }
} else { } else {
{{real_type}} r = b.real / b.imag; {{real_type}} r = b.real / b.imag;
{{real_type}} s = 1.0 / (b.imag + b.real * r); {{real_type}} s = ({{real_type}})(1.0) / (b.imag + b.real * r);
return {{type_name}}_from_parts( return {{type_name}}_from_parts(
(a.real * r + a.imag) * s, (a.imag * r - a.real) * s); (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment