るりまサーチ

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

別のキーワード

  1. math log
  2. math sqrt
  3. _builtin math
  4. bigdecimal/math e
  5. bigdecimal/math cos

ライブラリ

キーワード

検索結果

Float#angle -> 0 | Float (17.0)

自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。

...自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。

//emlist[例][ruby]{
1.arg # => 0
-1.arg # => 3.141592653589793
//}

ただし、自身が NaN(Not a number) であった場合は、NaN を返します。...

Float#arg -> 0 | Float (17.0)

自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。

...自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。

//emlist[例][ruby]{
1.arg # => 0
-1.arg # => 3.141592653589793
//}

ただし、自身が NaN(Not a number) であった場合は、NaN を返します。...

Float#phase -> 0 | Float (17.0)

自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。

...自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。

//emlist[例][ruby]{
1.arg # => 0
-1.arg # => 3.141592653589793
//}

ただし、自身が NaN(Not a number) であった場合は、NaN を返します。...

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

自身ともっとも近い整数もしくは実数を返します。

...t = Math::PI # => 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#flo...
...合発生します。

//emlist[例][ruby]{
1.0.round # => 1
1.2.round # => 1
(-1.2).round # => -1
(-1.5).round # => -2

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

t = t**10 # => 93648.04747608298
t.round(-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 (7.0)

自身ともっとも近い整数もしくは実数を返します。

...合発生します。

//emlist[例][ruby]{
1.0.round # => 1
1.2.round # => 1
(-1.2).round # => -1
(-1.5).round # => -2

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

t = t**10 # => 93648.04747608298
t.round(-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...

絞り込み条件を変える