J
johnny boy
Hello friends
I have just made this demo code.
namespace testdatatype
{
class Program
{
static void Main(string[] args)
{
double Value = long.MaxValue;
Console.WriteLine("Max value of long : " + long.MaxValue);
Console.WriteLine("Value in long of double is : " + (long)
Value);
Console.Read();
}
}
}
I am expecting that the value set to double e.g. max of long should be
printed on console but following output comes.
Max value of long : 9223372036854775807
Value in long of double is : -9223372036854775808
Also if i typecast it by ulong in Console.WriteLine() i get following
output.
Max value of long : 9223372036854775807
Value in long of double is : -9223372036854775808
Actualluy i want the exact value of long.MaxValue ?
Is there any way i can do this.
Thanks in advance
I have just made this demo code.
namespace testdatatype
{
class Program
{
static void Main(string[] args)
{
double Value = long.MaxValue;
Console.WriteLine("Max value of long : " + long.MaxValue);
Console.WriteLine("Value in long of double is : " + (long)
Value);
Console.Read();
}
}
}
I am expecting that the value set to double e.g. max of long should be
printed on console but following output comes.
Max value of long : 9223372036854775807
Value in long of double is : -9223372036854775808
Also if i typecast it by ulong in Console.WriteLine() i get following
output.
Max value of long : 9223372036854775807
Value in long of double is : -9223372036854775808
Actualluy i want the exact value of long.MaxValue ?
Is there any way i can do this.
Thanks in advance