You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: