c# - float doesn't register -
this question has answer here:
- division returns zero 6 answers
example:
output when debugging: bvar= 0.0
what missing?
you dividing integers, not floats.
use float bvarianza = (499f/ 500f);
instead.
your expression evaluated
float x = (float) (int / int)
.
after integers have been divided (which results in 0 because integers don't have fractal part) result stored in variable of type float, adds .0 fractal part.
Comments
Post a Comment