るりまサーチ (Ruby 2.7.0)

最速Rubyリファレンスマニュアル検索!
17件ヒット [1-17件を表示] (0.043秒)
トップページ > バージョン:2.7.0[x] > クエリ:Integer[x] > クラス:Float[x]

別のキーワード

  1. openssl integer
  2. asn1 integer
  3. _builtin integer
  4. integer chr
  5. integer new

ライブラリ

キーワード

検索結果

Float#to_i -> Integer (328.0)

小数点以下を切り捨てて値を整数に変換します。

...

@param ndigits 10進数での小数点以下の有効桁数を整数で指定します。
正の整数を指定した場合、Float を返します。
小数点以下を、最大 n 桁にします。
負の整数を指定した場合、Integer を返...

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

小数点以下を切り捨てて値を整数に変換します。

...

@param ndigits 10進数での小数点以下の有効桁数を整数で指定します。
正の整数を指定した場合、Float を返します。
小数点以下を、最大 n 桁にします。
負の整数を指定した場合、Integer を返...

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

自身と等しいかより大きな整数のうち最小のものを返します。

...

@param ndigits 10進数での小数点以下の有効桁数を整数で指定します。
正の整数を指定した場合、Float を返します。
小数点以下を、最大 n 桁にします。
負の整数を指定した場合、Integer を返...
...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#floor(ndigits = 0) -> Integer | Float (325.0)

自身と等しいかより小さな整数のうち最大のものを返します。

...

@param ndigits 10進数での小数点以下の有効桁数を整数で指定します。
正の整数を指定した場合、Float を返します。
小数点以下を、最大 n 桁にします。
負の整数を指定した場合、Integer を返...
...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 (310.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#round(ndigits = 0, half: :up) -> Integer | Float (310.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#denominator -> Integer (307.0)

自身を Rational に変換した時の分母を返します。

...自身を Rational に変換した時の分母を返します。

@return 分母を返します。

//emlist[例][ruby]{
2.0.denominator # => 1
0.5.denominator # => 2
//}

@see Float#numerator...

Float#hash -> Integer (307.0)

ハッシュ値を返します。

ハッシュ値を返します。

//emlist[例][ruby]{
pi1 = 3.14
pi2 = 3.14
pi3 = 3.1415

pi1.hash # => 335364239
pi2.hash # => 335364239
pi3.hash # => 420540030
//}

Float#numerator -> Integer (307.0)

自身を Rational に変換した時の分子を返します。

...自身を Rational に変換した時の分子を返します。

@return 分子を返します。

//emlist[例][ruby]{
2.0.numerator # => 2
0.5.numerator # => 1
//}

@see Float#denominator...

Float::DIG -> Integer (307.0)

Float が表現できる最大の 10 進桁数です。

...
Float
が表現できる最大の 10 進桁数です。

通常はデフォルトで 15 です。...

絞り込み条件を変える

Float::MANT_DIG -> Integer (307.0)

仮数部の Float::RADIX 進法での桁数です。

...仮数部の Float::RADIX 進法での桁数です。

通常はデフォルトで 53 です。...

Float::MAX_10_EXP -> Integer (307.0)

最大の 10 進の指数です。

...最大の 10 進の指数です。

通常はデフォルトで 308 です。

@see Float::MIN_10_EXP...

Float::MAX_EXP -> Integer (307.0)

最大の Float::RADIX 進の指数です。

...最大の Float::RADIX 進の指数です。

通常はデフォルトで 1024 です。

@see Float::MIN_EXP...

Float::MIN_10_EXP -> Integer (307.0)

最小の 10 進の指数です。

...最小の 10 進の指数です。

通常はデフォルトで -307 です。

@see Float::MAX_10_EXP...

Float::MIN_EXP -> Integer (307.0)

最小の Float::RADIX 進の指数です。

...最小の Float::RADIX 進の指数です。

通常はデフォルトで -1021 です。

@see Float::MAX_EXP...

絞り込み条件を変える

Float::RADIX -> Integer (307.0)

指数表現の基数です。

指数表現の基数です。

Float::ROUNDS -> Integer (307.0)

この定数は Ruby 2.7 から deprecated です。使わないでください。

この定数は Ruby 2.7 から deprecated です。使わないでください。


丸めモード (-1: 不定、0: 0.0 の方向に丸め、1: 四捨五入、2:正の無限
大の方向に丸め、3:負の無限大の方向に丸め)です。