About 20,200,000 results
Open links in new tab
  1. python - Taking the floor of a float - Stack Overflow

    Feb 23, 2012 · import math math.floor(3.1415) The problem with the first approach is that it return a float (namely 3.0). The second approach feels clumsy and too long. Are there alternative …

  2. Is there a ceiling equivalent of // operator in Python?

    Python floor division is defined as "that of mathematical division with the ‘floor’ function applied to the result" and ceiling division is the same thing but with ceil() instead of floor().

  3. How to round a number to significant figures in Python

    How to round a number to significant figures in Python Asked 15 years, 4 months ago Modified 1 year ago Viewed 427k times

  4. math - `/` vs `//` for division in Python - Stack Overflow

    In Python 3.x, 5 / 2 will return 2.5 and 5 // 2 will return 2. The former is floating point division, and the latter is floor division, sometimes also called integer division. In Python 2.2 or later in the …

  5. How to round the minute of a datetime object - Stack Overflow

    173 This will get the 'floor' of a datetime object stored in tm rounded to the 10 minute mark before tm.

  6. rounding - round down to 2 decimal in python - Stack Overflow

    I need to round down and it should be two decimal places. Tried the following, a = 28.266 print round(a, 2) 28.27 But the expected value is 28.26 only.

  7. What is the difference between int() and floor() in Python 3?

    5 Rounding down can be done in many ways, some methods are equivalent, e.g. built-in int, numpy.trunc and numpy.fix which truncate the number, meaning for a negative number they …

  8. python - Why does floating-point floor division return a different ...

    The question is not why floating point results are not exact but more about why python does two different things for floor(8.0/0.4) and the"floor-division" 8.0//0.4.

  9. python - Floor division with negative number - Stack Overflow

    The expression 6 // 4 yields 1, where floor division produces the whole number after dividing a number. But with a negative number, why does -6 // 4 return -2?

  10. Ceil and floor equivalent in Python 3 without Math module?

    Sep 14, 2015 · Ceil and floor equivalent in Python 3 without Math module? Asked 10 years, 2 months ago Modified 3 years, 5 months ago Viewed 73k times