<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>After launched the IronPython interpreter, i tried 
these simple inputs:<BR>&gt;&gt;&gt; 1.5<BR>or<BR>&gt;&gt;&gt; 1.5 + 2.5<BR>Each 
time, an exception raised and i was disappointed.<BR>On my home computer, it's 
the same thing with this C# code snippet:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>string x = "1.5";<BR>string y = 
2.5";<BR>Console.WriteLine("x + y = {0}", Convert.ToDouble(x) + 
Convert.ToDouble(y));</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>But the following code will work fine:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>string x = "1,5";<BR>string y = 
2,5";<BR>Console.WriteLine("x + y = {0}", Convert.ToDouble(x) + 
Convert.ToDouble(y));</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Like all .NET assemblies, the IronPython 
interpreter will use the current Culture informations.<BR>For some no English 
user like me, it's the reason that you get an exception with double values in 
the interpreter or in the b3/b5 modules when you try the parrotbench 
test.<BR>But i wanted to do this benchmark and the idea was to change the 
Culture informations.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>After to have modified the parrotrun.py file 
(renamed parrotrunUS.py) like this:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>.........<BR>.........<BR>""" This provides a more 
convenient harness for running this<BR>&nbsp;&nbsp;&nbsp; benchmark and 
collecting separate timings for each component.<BR>"""</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>from time import clock<BR>import sys</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>#Begin new code<BR>from System import 
Threading<BR>from System import Globalization</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Threading.Thread.CurrentThread.CurrentCulture = 
Globalization.CultureInfo.CreateSpecificCulture("en-US")<BR>#End new 
code</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>t0 = clock()<BR>import b0<BR>import 
b1<BR>.........<BR>.........</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>The test had worked. You can do the same thing with 
the interpreter<BR>&gt;&gt;&gt;from System import Threading<BR>&gt;&gt;&gt;from 
System import 
Globalization<BR>&gt;&gt;&gt;Threading.Thread.CurrentThread.CurrentCulture = 
Globalization.CultureInfo.CreateSpecificCulture("en-US")<BR>&gt;&gt;&gt; 1.54 + 
2.28<BR>&gt;&gt;&gt;3.82</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>This modification is only usefull for some 
people.<BR>@+</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><A 
href="http://mail.spaminspector.com"></A></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV></BODY></HTML>