(int)
cast of double
rounds the double instead of truncating it
#130
Labels
(int)
cast of double
rounds the double instead of truncating it
#130
In
C#
the callproduces
x = 3
.The same call in ExpressionEvaluator produces
x = 4
instead.This is due to the usage of
in line 4150, which for the given example resolves to
Convert.ChangeType(3.6, typeof(int))
which indeed resolves to 4.I understand if this is a design decision, but it might be a source of issues. We use ExpressionEvaluator to simulate
C#
code, which means for us, it is non-expected behavior.For our intents and purposes it would be great to have an option to turn integer casting from
round
totruncate
e.g. withThis would preserve current behavior but enable a more correct simulation of
C#
behavior.The text was updated successfully, but these errors were encountered: