About 59 results
Open links in new tab
  1. python - How do you round UP a number? - Stack Overflow

    May 5, 2017 · Elaboration: math.ceil returns the smallest integer which is greater than or equal to the input value. This function treats the input as a float (Python does not have strongly-typed variables) …

  2. Why do Python's math.ceil() and math.floor() operations return floats ...

    Dec 21, 2011 · Can someone explain this (straight from the docs - emphasis mine): math.ceil (x) Return the ceiling of x as a float, the smallest integer value greater than or equal to x. math.floor (x) Return …

  3. 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().

  4. getting Ceil() of Decimal in python? - Stack Overflow

    May 12, 2015 · That works because math.ceil is overloadable for custom types in Python 3. In Python 2, math.ceil simply converts the Decimal instance to a float first, potentially losing information in the …

  5. Applying math.ceil to an array in python - Stack Overflow

    May 31, 2015 · Documentation states that math.ceil returns the ceiling for any input x, but what is the best method of applying this ceiling function to every element contained within the array?

  6. python - Why does math.ceil return a float? - Stack Overflow

    Possible Duplicate: Why do Python's math.ceil () and math.floor () operations return floats instead of integers? From the Python documentation of math.ceil... math. ceil (x) Return the ceiling of x as a …

  7. python - floor and ceil with number of decimals - Stack Overflow

    Sep 23, 2019 · The function np.round accepts a decimals parameter but it appears that the functions ceil and floor don't accept a number of decimals and always return a number with zero decimals.

  8. 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, 5 months ago Modified 3 years, 8 months ago Viewed 74k times

  9. Round up to second decimal place in Python - Stack Overflow

    How can I round up a number to the second decimal place in Python? For example: 0.022499999999999999 Should round up to 0.03 0.1111111111111000 Should round up to 0.12 If …

  10. When rounding a decimal/float to an integer, what's the difference ...

    Jul 13, 2021 · When trying to round a decimal point value (a float) to an integer, what is the actual difference between the round, math.floor and math.ceil functions in python?