Hi friends,
I want to know that, If a procedure fun() is to receive an int, a Single & a double and it is to return a decimal then what is the way to define this procedure?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Dec 3, 2011, 3:24 PM
You can prove that C#'s float type is just an alias for System.Single by running this little program:
Prabhu RajaPosted Dec 3, 2011, 2:59 PM
Adding to vulpes,
Vulpes, i can't understand how you determine float is equal to System.Single.
for example, we can assign 1.01 to float datatype with precision but we can't do the same with System.Single.
So, my suggestion is,
public Decimal Fun(Int32 i, Int16 f,Double d)
{
//Return Decimal value
}
VulpesPosted Dec 3, 2011, 8:46 AM
decimal Fun(int i, float f, double d)
{
// code needs to return a decimal on exit
}
Note that System.Single is the same as float in C#.