_agx_
asked on
What happens to fractional values when casting from double to int? (beginner)
From what I can tell, the fractional values are truncated and the result is Math.floor().
double dx = 4968525.66;
Console.WriteLine((int)dx) ; // 4968525
Console.WriteLine(Math.Flo or(dx)); // 4968525
Is that always true? Any difference for negative values?
double dx = 4968525.66;
Console.WriteLine((int)dx)
Console.WriteLine(Math.Flo
Is that always true? Any difference for negative values?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Just the answer I was looking for, thanks.
NP. Glad to help = )
ASKER
Ah, right. I'm forgetting basic math ... ;-)