17
15

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.

【PHP】割り算の切り上げ、切り捨て、四捨五入

Posted at

まずはじめに

ちょっとあることをしている処理にかかる時間を計測して時間・分・秒に変換する際に調べることになったので記録。

『処理にかかる時間を計測して時間・分・秒に変換して表示するというのを行う』というのは後で違う記事として掲載しておきます。

#本題

切り捨て

floor(x/y)

切り上げ

ceil(x/y)

四捨五入

round(x/y)

17
15
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
17
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?