0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【のーと】任意桁の切り捨て,切り上げ(小数点でない)

Posted at
x = int(input())
#  いったんrange(今回は100)で割って小数点を切り捨ててから100掛ける
def floor(src, range):
    return (int)(src / range) * range

print(floor(x,100))

# ちな,切り上げ
def ceil(src, range):
    return ((int)(src / range) + 1 ) * range

参照ではなく丸パクリ文献:
http://terukizm.hatenablog.com/entry/20120505/1336218368

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?