39件ヒット
[1-39件を表示]
(0.102秒)
種類
- ライブラリ (11)
- 特異メソッド (11)
- インスタンスメソッド (11)
- 定数 (6)
ライブラリ
- ビルトイン (22)
-
shell
/ process-controller (6)
クラス
- Module (11)
-
Shell
:: ProcessController (6)
オブジェクト
- main (11)
キーワード
検索結果
先頭4件
-
Module
# using(module) -> self (27307.0) -
引数で指定したモジュールで定義された拡張を現在のクラス、モジュールで有 効にします。
...ルで有
効にします。
有効にした拡張の有効範囲については以下を参照してください。
* https://docs.ruby-lang.org/en/master/syntax/refinements_rdoc.html#label-Scope
@param module 有効にするモジュールを指定します。
@see Module#refine, main.using... -
main
. using(module) -> self (24313.0) -
引数で指定したモジュールで定義された拡張を有効にします。
...https://docs.ruby-lang.org/en/master/syntax/refinements_rdoc.html#label-Scope
@param module 有効にするモジュールを指定します。
//emlist[例][ruby]{
module Sloth
refine String do
def downcase
self
end
end
end
"ABC".downcase # => "abc"
using Sloth
"ABC".downcas......e # => "ABC"
//}
@see Module#refine, Module#using... -
Shell
:: ProcessController :: USING _ AT _ EXIT _ WHEN _ PROCESS _ EXIT -> true (18201.0) -
@todo
@todo -
bigdecimal (6012.0)
-
bigdecimal は浮動小数点数演算ライブラリです。 任意の精度で 10 進表現された浮動小数点数を扱えます。
...bigdecimal は浮動小数点数演算ライブラリです。
任意の精度で 10 進表現された浮動小数点数を扱えます。
//emlist[][ruby]{
require 'bigdecimal'
a = BigDecimal("0.123456789123456789")
b = BigDecimal("123456.78912345678", 40)
print a + b # => 0.123456912580245903456......//emlist[pi.rb][ruby]{
#!/usr/local/bin/ruby
require "bigdecimal"
#
# Calculates 3.1415.... (the number of times that a circle's diameter
# will fit around the circle) using J. Machin's formula.
#
def big_pi(sig) # sig: Number of significant figures
exp = -sig
pi = BigDecimal("0")
tw......[0].to_i)
else
puts "TRY: ruby pi.rb 1000"
end
end
//}
=== その他
以下のメソッド以外にも、(C ではない) Ruby ソースの形で提供されているものもあります。例えば、
//emlist[][ruby]{
require "bigdecimal/math"
//}
とすることで、sin や cos と...