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 1 year has passed since last update.

[5行メモ]切り捨て・切り上げの名前をど忘れしたら

Last updated at Posted at 2022-03-30

JavaScriptだと Math.ceilMath.floor、 Java/Kotlinだと BigDecimal.divide(divisor, roundingMode) とかで切り捨て・切り上げが出てきますが、どっちだったっけ?と迷うことが偶にあります。

そんなときの簡単な覚え方。

  • ceil/ceiling: シーリング、天井(シーリングライトとかの)。上のほうなので切り上げ。正の数に近い方になります。
  • floor: フロア、床(フロアマットとかの)。下のほうなので切り下げ。負の数に近い方になります。
0
0
2

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?