|
-
Feb 22nd, 2006, 05:02 PM
#1
Thread Starter
Lively Member
Compile Problem.
HI i get this error
Error 33 The call is ambiguous between the following methods or properties: 'System.Math.Ceiling(decimal)' and 'System.Math.Ceiling(double)' C:\Documents and Settings\B\Desktop\Lewies_Min177620812004\MiniHexEdit\Form1.cs 491 22 MiniHexEdit
On this line:
Code:
int items = (int)System.Math.Ceiling((listView1.Height - headerFooter) / itemHeight);
Any ideas?
-
Feb 22nd, 2006, 07:07 PM
#2
Re: Compile Problem.
It means your code could be considered a decimal or a double and you have to tell it what. You could just use the Convert.ToDecimal or Convert.ToDouble (or just a Double.Parse()).
-
Feb 22nd, 2006, 07:13 PM
#3
Re: Compile Problem.
What type does the expression you are passing to Math.Ceiling return? You can find out by placing a breakpoint on that line and pasting that expression into the Watch window. Presumably it is not returning either a Double or Decimal, so it needs to be converted to one of those types because they are the only types that Math.Ceiling accepts. Computers can't "guess" which way to go. If there are two equally likely possibilites a computer just says "don't know, give up". Basically, you have to tell it whether it is dealing with a Double or a Decimal.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|