How to do it...

  1. The ceil(x) function returns the smallest integer >= x. Normal mathematical rounding is not used, so 12.3 will be rounded up to 13, rather than rounding up starting at 12.5; any value greater than x.0 will be rounded up to the next value, as shown in the following screenshot:
  1. The copysign(x, y) function returns a float value with an absolute value of x but with the sign of y. If the OS supports signed zeros, copysign(1.0, -0.0) gives the value -1.0, as shown in the following screenshot:
  1. The  fabs(x) function returns the ...

Get Secret Recipes of the Python Ninja now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.