Mikioo / sharpkit

Automatically exported from code.google.com/p/sharpkit
0 stars 0 forks source link

Casts between numeric values do not have expected effect #234

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
double a = 2432.2342423424;
int b = (int) a;
Console.WriteLine(b.ToString());

Expected output: 2432
Actual output:   2432.2342423424

(tested on Chromium)

Original issue reported on code.google.com by yvan.rod...@gmail.com on 5 Oct 2012 at 4:16

GoogleCodeExporter commented 8 years ago
Workaround: I have implemented Math.Truncate()

Original comment by yvan.rod...@gmail.com on 5 Oct 2012 at 4:31