dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[DotGNU]Re: <PNET> String.Replace(char,char) bug & fix


From: Rhys Weatherley
Subject: [DotGNU]Re: <PNET> String.Replace(char,char) bug & fix
Date: Wed, 06 Feb 2002 15:53:59 +1000

"Gopal.V" wrote:

> Hi Rhys,
>         This is a *real* bug in the runtime engine. The extern method of
> String.Replace(char,char) is wrong !.

Whoops!  Thanks for finding this.  Fixed now.

>         Also another bug seems to be that the Random.Next(int MaxValue)
> always seems to return a big negative number -18446744071562067968.
> But couldn't pin it down. Code for that is also attatched.

The big negative number was a bug in the "ToString" method
in "Int32".  Negative numbers were being sign-extended to
long, which caused very odd values to appear for -MaxInt.

The reason why it was returning the same number every time
was quite bizarre.  There was a bug in the CVM "return_n"
instruction which caused it to return the wrong value to the
caller, which by magic always corresponded to -MaxInt.
This only happens for large value types and for floating
point values.  Since Random uses floating-point internally,
it activated the bug.

A few more floating-point tests may be in order, although I'll
need to implement FP ToString methods in the library class
"System.Private.NumberFormatter" first.

Cheers,

Rhys.

P.S. I apologise for the slow response over the last couple
of weeks on patches and bug reports.  Things were a bit
strange here last week, and this week I'm at a conference.
Catching up on bugs and patches is the first priority once
I get back to pnet next week, followed by an official release.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]