Error in code after converting to VS.NET 2005?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

After converting my project from VS.NET 2003 to VS.NET 2005 I am receiving
the error:

The call is ambiguous between the following methods or properties:
'System.Math.Floor(decimal)' and 'System.Math.Floor(double)'

For the line of code:

byte upperValue = (byte)Math.Floor(bytes/16);

Thanks in advanced for any help,
Asaf
 
Hi Asaf,

You're receiving this error because the compiler is not sure which overload
you're trying to use for the Floor method. In .NET framework 1.1, there is
only one overload for this while in .NET framework 2.0, there are two of
them. You can try the following

double d = bytes/16;
byte upperValue = (byte)Math.Floor(d);

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
You're welcome!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Back
Top