471,306 Members | 1,289 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,306 software developers and data experts.

Error in code after converting to VS.NET 2005?

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[i]/16);

Thanks in advanced for any help,
Asaf

Feb 14 '06 #1
3 1908
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[i]/16;
byte upperValue = (byte)Math.Floor(d);

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

Feb 14 '06 #2
Hi Kevin,

Thanks for your help :-)

Regards,
Asaf

"Kevin Yu [MSFT]" wrote:
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[i]/16;
byte upperValue = (byte)Math.Floor(d);

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

Feb 14 '06 #3
You're welcome!

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

Feb 15 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Zibi | last post: by
1 post views Thread by amitbadgi | last post: by
9 posts views Thread by Michael Tissington | last post: by
5 posts views Thread by marathoner | last post: by
5 posts views Thread by PLS | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.