bugDotGNU Portable.NET - Bugs: bug #2222, [0.5.0] Lots of bugs in...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #2222: [0.5.0] Lots of bugs in Double.Parse

Submitted by:  Yannis BRES <yannis_bres>
Submitted on:  Wed 15 Jan 2003 01:56:51 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Tue 28 Jan 2003 06:26:54 AM UTC, comment #1:

Appears to have been fixed by Jonathan Springer according
to the ChangeLog - please re-test.

Rhys Weatherley <rweather>
Project Administrator
Wed 15 Jan 2003 01:56:51 PM UTC, original submission:

Double.Parse does not properly parse numbers with unrelevant digits (trailing 0). Unfortunately, real numbers are now printed with a fixed size and, therefore, unrelevant digits.
Moreveover, Double.Parse (actually System.Private.NumberParser.ParseDouble(String, NumberStyles, NumberFormatInfo) in ./System/Private/NumberParser.cs:1143) requires the exponent symbol (e|E) to be followed by a sign, while + should be considered as default.
Here is the output I have of the following test program :
$ cscc DoubleParse.cs -o DoubleParse.exe ; ilrun DoubleParse.exe
Attempting to parse [0.0]...
Failure : Attempt to negate the largest negative integer.
at System.Math.Abs(Int32) in ./System/Math.cs:78
at System.Private.NumberFormat.ScientificFormatter.Format(Object, IFormatProvider) in ./System/Private/NumberFormat/ScientificFormatter.cs:93
at System.Private.NumberFormat.GeneralFormatter.Format(Object, IFormatProvider) in ./System/Private/NumberFormat/GeneralFormatter.cs:96
at System.Double.ToString(String, IFormatProvider) in ./System/Double.cs:109
at System.String.Format(IFormatProvider, String, Object[]) in ./System/String.cs:776
at System.String.Format(String, Object) in ./System/String.cs:585
at System.IO.TextWriter.WriteLine(String, Object) in ./System/IO/TextWriter.cs:199
at DoubleParse.Main()

Attempting to parse [0.5]...
Success ;-) : [0.500000000000000]

Attempting to parse [0.500000000000000]...
Success ;-) : [0.138223616000000]

Attempting to parse [1.13]...
Success ;-) : [1.130000000000000]

Attempting to parse [1.130000000000000]...
Success ;-) : [1.422485196800000]

Attempting to parse [1e+2]...
Success ;-) : [100.000000000000000]

Attempting to parse [1e-2]...
Success ;-) : [0.010000000000000]

Attempting to parse [1e2]...
Failure : Exponent notation must include a sign on the exponent
at System.Private.NumberParser.ParseDouble(String, NumberStyles, NumberFormatInfo) in ./System/Private/NumberParser.cs:1143
at System.Double.Parse(String, NumberStyles, IFormatProvider) in ./System/Double.cs:120
at System.Double.Parse(String) in ./System/Double.cs:142
at DoubleParse.Main()

Have fun !

Yannis BRES <yannis_bres>

 

Attached Files
file #236:  DoubleParse.cs added by yannis_bres (872B - text/plain - Test program for Double.Parse)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Tue 28 Jan 2003 06:26:54 AM UTCrweatherStatusNone=>(Error - Not Found)
  Open/ClosedOpen=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1