Open BrunoGagnon-Eaton opened 6 years ago
Should be easy enough to fix
On second thought, I will leave this open until Python type inference is completed. I don't want to sprinkle unnecessary casts in the code if pytocs can prove a variable is a numeric type that will be promoted to floating point by the C# compiler.
Currently, the code is just forwarded ‘as is’ during conversion and gives a C# result of type integer. The problem appy to Python (3.x and more).
Example:
Py: b=3; r= 1/b # r = 0.3333333333333 C#: int b=3; var r= 1/b; // r = 0 !!! C# (expected example): int b=3; var r= 1/(float)(b); // r = 0.3333333333333