[Mono-list] Convert.ToSingle/Convert.ToDouble with empty string succeeds

Colin JN Breame colin at breame.net
Thu Mar 16 10:16:33 EST 2006

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


public class test_t {
        public static void Main() {

$ mcs test.cs && mono test.exe

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?

 -- Colin

PS. mono

More information about the Mono-list mailing list