2件ヒット
[1-2件を表示]
(0.116秒)
ライブラリ
- cmath (1)
- forwardable (1)
キーワード
- CMath (1)
- SingleForwardable (1)
検索結果
先頭2件
-
SingleForwardable (18022.0)
-
オブジェクトに対し、メソッドの委譲機能を定義するモジュールです。
...ようにする事もできます。
require 'forwardable'
class Implementation
def self.service
puts "serviced!"
end
end
module Facade
extend SingleForwardable
def_delegator :Implementation, :service
end
Facade.service # => serviced!
もし Forwardable と Si... -
CMath (58.0)
-
複素数演算をサポートするモジュールです。
複素数演算をサポートするモジュールです。
Math モジュールの複素数版です。同名のメソッドを複素数対応します。
従来の計算結果が必要な場合は、「メソッド名!」の形式で呼び出します。
//emlist[例][ruby]{
require "cmath"
# 複素数の範囲の立方根(の主値)= exp(1/3 πi)
CMath.cbrt(-1) # => (0.5000000000000001+0.8660254037844386i)
# 実数の範囲の立方根
Math.cbrt(-1) # => -1.0
include CMath
# レシーバー無しで使える
cbrt(-1) # ...