Hi,

Colin JN Breame wrote:
It appears that if you use Convert.ToSingle or Convert.ToDouble on an empty string, the method succeeds and returns 0.

e.g.

public class test_t {
        public static void Main() {
                System.Console.WriteLine(System.Convert.ToSingle(""));
        }
}

$ mcs test.cs && mono test.exe
0

I would expect it to throw a System.FormatException like Convert.ToInt32. How does this compare to the MS CLR behaviour? Is this a bug or a feature?

It's a bug. Just fixed in svn. Thanks for the info.

Atsushi Eno
_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to