bugDotGNU Portable.NET - Bugs: bug #26199, incorrect result for...

 
 

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

bug #26199: incorrect result for System.TimeSpan.MinValue.ToString()

Submitted by:  Thomas Uxiou <uxiou>
Submitted on:  Thu 16 Apr 2009 11:34:39 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Sat 18 Apr 2009 06:58:19 PM UTC, comment #1:

Just commited your patch in CVS (hope i did it right, had some troubles to extract the patch from the text).

Thanks!

Radek Polak <radekp>
Project Member
Thu 16 Apr 2009 11:34:39 AM UTC, original submission:

Console.WriteLine("{0}", System.TimeSpan.MinValue.ToString());

output: -10675199.0.:,(:0+.,))+(0(
expected: -10675199.02:48:05.4775808

patch:
# --- runtime/System/TimeSpan.cs 2009-04-16 11:19:09.000000000 +0200
# +++ runtime/System/TimeSpan.cs.fixed 2009-04-16 11:36:21.000000000 +0200
# @@ -108,20 +108,28 @@
# // Formatting.
# public override String ToString()
# {
# - int days = Days;
# - int hours = Hours;
# - int minutes = Minutes;
# - int seconds = Seconds;
# + int days = (int) Math.Abs(Days);
# + int hours = (int) Math.Abs(Hours);
# + int minutes = (int) Math.Abs(Minutes);
# + int seconds = (int) Math.Abs(Seconds);
# int fractional = unchecked((int)(value_ % TicksPerSecond));
# + fractional = (int) Math.Abs(fractional);
# +
# String result;
# - if(days != 0)
# + if(value_ < 0)
# {
# - result = days.ToString() + ".";
# + result = "-";
# }
# else
# {
# result = String.Empty;
# }
# +
# + if(days != 0)
# + {
# + result += days.ToString() + ".";
# + }
# +
# result = result + TwoDigits(hours) + ":" +
# TwoDigits(minutes) + ":" + TwoDigits(seconds);
# if(fractional != 0)

Thomas Uxiou <uxiou>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by radekp (Posted a comment)
  • -unavailable- added by uxiou (Submitted the item)
  •  

    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
    Sat 18 Apr 2009 06:58:19 PM UTCradekpStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1