33件ヒット [1-33件を表示] （0.008秒）
トップページ > クラス:Float > :ceil

## 検索結果

### Float#ceil(ndigits = 0) -> Integer | Float (18204.0)

...合、Float を返します。

//emlist[例][ruby]{
1.2.ceil # =...
...2
2.0.ceil # => 2
(-1.2).ceil # => -1
(-2.0).ceil # => -2

1.234567.ceil(2) # => 1.24
1.234567.ceil(3) # => 1.235
1.234567.ceil(4) # => 1.2346
1.234567.ceil(5) # => 1.23457

34567.89.ceil(-5) # => 100000
34567.89.ceil(-4) # => 40000
34567.89.ceil(-3) # => 35000
34567.89.ceil(-2)...
...# => 34600
34567.89.ceil(-1) # => 34570
34567.89.ceil(0) # => 34568
34567.89.ceil(1) # => 34567.9
34567.89.ceil(2) # => 34567.89
34567.89.ceil(3) # => 34567.89
//}

@see Float#floor, Float#round, Float#truncate...

### Float#ceil -> Integer (18126.0)

...り大きな整数のうち最小のものを返します。

//emlist[例][ruby]{
1.2.ceil # => 2
2.0.ceil # => 2
(-1.2).ceil # => -1
(-2.0).ceil # => -2
//}

@see Float#floor, Float#round, Float#truncate...

### Float#floor -> Integer (7.0)

...

//emlist[例][ruby]{
1.2.floor # => 1
2.0.floor # => 2
(-1.2).floor # => -2
(-2.0).floor # => -2
//}

@see Numeric#ceil, Numeric#round, Float#truncate...

### Float#floor(ndigits = 0) -> Integer | Float (7.0)

...

@param ndigits 10進数での小数点以下の有効桁数を整数で指定します。

...oor(-4) # => 30000
34567.89.floor(-3) # => 34000
34567.89.floor(-2) # => 34500
34567.89.floor(-1) # => 34560
34567.89.floor(0) # => 34567
34567.89.floor(1) # => 34567.8
34567.89.floor(2) # => 34567.89
34567.89.floor(3) # => 34567.89
//}

@see Numeric#ceil, Numeric#round, Float#truncate...

### Float#round(ndigits = 0) -> Integer | Float (7.0)

...3.141592653589793
t.round(3) # => 3.142
t.round(0) # => 3
t.round(1) # => 3.1

t = t**10 # => 93648.04747608298
t.round(-0) # => 93648
t.round(-1) # => 93650
t.round(-2) # => 93600
t.round(-3) # => 94000
t.round(-100) # => 0
//}

@see Float#ceil, Float#floor, Float#truncate...
...d(-2) # => 93600
t.round(-3) # => 94000
t.round(-100) # => 0

2.5.round(half: :up) # => 3
2.5.round(half: :even) # => 2
2.5.round(half: :down) # => 2
3.5.round(half: :up) # => 4
3.5.round(half: :even) # => 4
3.5.round(half: :down) # => 3
//}

@see Float#ceil, Float#floor, Float#truncate...

### Float#round(ndigits = 0, half: :up) -> Integer | Float (7.0)

...d(-2) # => 93600
t.round(-3) # => 94000
t.round(-100) # => 0

2.5.round(half: :up) # => 3
2.5.round(half: :even) # => 2
2.5.round(half: :down) # => 2
3.5.round(half: :up) # => 4
3.5.round(half: :even) # => 4
3.5.round(half: :down) # => 3
//}

@see Float#ceil, Float#floor, Float#truncate...

### Float#to_i -> Integer (7.0)

...を整数に変換します。

//emlist[例][ruby]{
2.8.truncate # => 2
(-2.8).truncate # => -2
//}

@see Numeric#round, Numeric#ceil, Numeric#floor...
...

@param ndigits 10進数での小数点以下の有効桁数を整数で指定します。

...す。

//emlist[例][ruby]{
2.8.truncate # => 2
(-2.8).truncate # => -2
1.234567.truncate(2) # => 1.23
34567.89.truncate(-2) # => 34500
//}

@see Numeric#round, Numeric#ceil, Numeric#floor...

### Float#truncate -> Integer (7.0)

...を整数に変換します。

//emlist[例][ruby]{
2.8.truncate # => 2
(-2.8).truncate # => -2
//}

@see Numeric#round, Numeric#ceil, Numeric#floor...

### Float#truncate(ndigits = 0) -> Integer | Float (7.0)

...

@param ndigits 10進数での小数点以下の有効桁数を整数で指定します。

...す。

//emlist[例][ruby]{
2.8.truncate # => 2
(-2.8).truncate # => -2
1.234567.truncate(2) # => 1.23
34567.89.truncate(-2) # => 34500
//}

@see Numeric#round, Numeric#ceil, Numeric#floor...