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?
Functions and Subroutines in C#
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Dec 3, 2011, 3:46 AM EST
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#.
Prabhu RajaRank #861 · 2.6K reputationPosted Dec 3, 2011, 9:59 AM EST
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
}
VulpesRank #55 · 29.2K reputationPosted Dec 3, 2011, 10:24 AM EST
You can prove that C#'s float type is just an alias for System.Single by running this little program: