About 55 results
Open links in new tab
  1. Why does Python 3 round half to even? - Stack Overflow

    250 Python 3's way (called "round half to even" or "banker's rounding") is considered the standard rounding method these days, though some language implementations aren't on the bus yet. …

  2. ¿Cómo redondear "correctamente" en python? - Stack Overflow …

    14 Por qué esto ocurre está explicado en ¿Por qué en Python 3 round () redondea 3.5 a 4 pero 2.5 a 2?. Básicamente, Python 3 utiliza el bankers rounding, es decir, el redondeo del …

  3. python - Round number to nearest integer - Stack Overflow

    round(x) will round it and change it to integer. You are not assigning round(h) to any variable. When you call round(h), it returns the integer number but does nothing else; you have to …

  4. python - How to round a floating point number up to a certain …

    Jan 22, 2015 · Here, num is the decimal number. x is the decimal up to where you want to round a floating number. The advantage over other implementation is that it can fill zeros at the right …

  5. python - How do you round UP a number? - Stack Overflow

    May 5, 2017 · How does one round a number UP in Python? I tried round (number) but it rounds the number down. Here is an example: round (2.3) = 2.0 and not 3, as I would like. Then I tried …

  6. python - Round float to x decimals? - Stack Overflow

    In Python 2.7 and later, we have the pleasant situation that the two conversions in step 3 and 4 cancel each other out. That's due to Python's choice of repr implementation, which produces …

  7. python - How to properly round-up half float numbers? - Stack …

    The Numeric Types section documents this behaviour explicitly: round(x[, n]) x rounded to n digits, rounding half to even. If n is omitted, it defaults to 0. Note the rounding half to even. This is …

  8. python - round () doesn't seem to be rounding properly - Stack …

    The documentation for the round() function states that you pass it a number, and the positions past the decimal to round. Thus it should do this: n = 5.59 round(n, 1) # 5.6 But, in actuality, …

  9. How to round to 2 decimals with Python? [duplicate]

    Dec 9, 2013 · How to round to 2 decimals with Python? [duplicate] Asked 12 years ago Modified 1 year, 8 months ago Viewed 2.3m times

  10. How does Rounding in Python work? - Stack Overflow

    Jan 6, 2016 · >>> round(0.25,1) # this makes sense 0.3 >>> round(0.35,1) # in my opinion, should be 0.4 but evaluates to 0.3 0.3 Edit: So in general, there is a possibility that Python …