[IronPython] PythonEngine.EvaluateAs and future division

Kristof Wagemans kristof.wagemans at gmail.com
Wed Jul 26 18:07:32 CEST 2006


The following code gives different results. Is this expected or a bug?

 

IronPython.Compiler.Options.Division =
IronPython.Compiler.DivisionOption.New;

PythonEngine _pe = new PythonEngine();

_pe.Execute("result1 = 1/2");

double result1 = Convert.ToDouble(_pe.Globals["result1"]);

double result2 = _pe.EvaluateAs<double>("1/2");

 

result1 = 0.5

result2 = 0.0

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20060726/73e11be3/attachment.html>


More information about the Ironpython-users mailing list