ライブラリ
- ビルトイン (687)
-
cgi
/ html (517) - cmath (120)
-
json
/ add / complex (22) - matrix (22)
-
ripper
/ lexer (44)
クラス
- Bignum (3)
- Complex (549)
- Fixnum (3)
- Matrix (22)
- NilClass (11)
- Numeric (44)
- Ripper (11)
-
Ripper
:: Lexer (33) - SignalException (55)
- String (11)
モジュール
-
CGI
:: HtmlExtension (517) - CMath (120)
- Kernel (22)
キーワード
- * (11)
- ** (11)
- + (11)
- -@ (11)
-
/ (11) - < (11)
- <= (11)
- <=> (5)
- == (11)
- > (11)
- >= (11)
- Complex (33)
- I (11)
- a (22)
- abs (11)
- abs2 (11)
- acos (6)
- acosh (6)
- angle (11)
- arg (11)
- asin (6)
- asinh (6)
- atan (6)
- atan2 (6)
- atanh (6)
- base (11)
- between? (11)
- blockquote (22)
- cbrt (6)
- checkbox (22)
-
checkbox
_ group (22) - clamp (11)
- coerce (11)
- conj (11)
- conjugate (11)
- cos (6)
- cosh (6)
- denominator (11)
- exp (6)
- fdiv (28)
-
file
_ field (22) - finite? (8)
- form (44)
- hidden (22)
- html (22)
- i (11)
- imag (11)
- imaginary (11)
- img (22)
- infinite? (8)
- inspect (11)
-
irb
/ ruby-lex (11) -
irb
/ slex (6) -
json
_ create (11) - log (12)
- log10 (6)
- log2 (6)
- magnitude (11)
-
marshal
_ dump (11) -
multipart
_ form (44) - new (33)
- numerator (11)
- parse (11)
-
password
_ field (22) - phase (11)
- polar (22)
- quo (22)
-
radio
_ group (22) - rationalize (22)
- real (11)
- real? (11)
- rect (22)
- rectangular (22)
- reset (22)
-
scrolling
_ list (22) - signm (11)
- signo (11)
- sin (6)
- sinh (6)
- sqrt (6)
- submit (22)
- tan (6)
- tanh (6)
-
text
_ field (22) - textarea (22)
-
to
_ c (44) -
to
_ f (11) -
to
_ i (11) -
to
_ json (11) -
to
_ r (11) -
to
_ s (11) - tokenize (11)
- tr (11)
- trace (11)
検索結果
先頭5件
- Ripper
:: Lexer # lex -> [[Integer , Integer] , Symbol , String , Ripper :: Lexer :: State] - Complex
# -(other) -> Complex - Ripper
:: Lexer # lex -> [[Integer , Integer] , Symbol , String] - Ripper
. lex(src , filename = & # 39;-& # 39; , lineno = 1 , raise _ errors: false) -> [[Integer , Integer] , Symbol , String , Ripper :: Lexer :: State] - Ripper
. lex(src , filename = & # 39;-& # 39; , lineno = 1) -> [[Integer , Integer] , Symbol , String , Ripper :: Lexer :: State]
-
Ripper
:: Lexer # lex -> [[Integer , Integer] , Symbol , String , Ripper :: Lexer :: State] (21307.0) -
自身の持つ Ruby プログラムをトークンに分割し、そのリストを返します。
...自身の持つ Ruby プログラムをトークンに分割し、そのリストを返します。
ライブラリ内部で使用します。 Ripper.lex を使用してください。... -
Complex
# -(other) -> Complex (21212.0) -
差を計算します。
...差を計算します。
@param other 自身から引く数
//emlist[例][ruby]{
Complex(1, 2) - Complex(2, 3) # => (-1-1i)
//}... -
Ripper
:: Lexer # lex -> [[Integer , Integer] , Symbol , String] (21207.0) -
自身の持つ Ruby プログラムをトークンに分割し、そのリストを返します。
...自身の持つ Ruby プログラムをトークンに分割し、そのリストを返します。
ライブラリ内部で使用します。 Ripper.lex を使用してください。... -
Ripper
. lex(src , filename = & # 39;-& # 39; , lineno = 1 , raise _ errors: false) -> [[Integer , Integer] , Symbol , String , Ripper :: Lexer :: State] (18331.0) -
Ruby プログラム str をトークンに分割し、そのリストを返します。 ただし Ripper.tokenize と違い、トークンの種類と位置情報も付属します。
...を文字列か IO オブジェクトで指定します。
@param filename src のファイル名を文字列で指定します。省略すると "-" になります。
@param lineno src の開始行番号を指定します。省略すると 1 になります。
@param raise_errors true を指定......SyntaxError raise_errors が true で、src に文法エラーがある場合に発生します。
//emlist[][ruby]{
require 'ripper'
pp Ripper.lex("def m(a) nil end")
# => [[[1, 0], :on_kw, "def", FNAME],
# [[1, 3], :on_sp, " ", FNAME],
# [[1, 4], :on_ident, "m", ENDFN],
# [[1, 5],......on_kw, "nil", END],
# [[1, 12], :on_sp, " ", END],
# on_kw, "end", END
Ripper.lex("def req(true) end", raise_errors: true)
# => SyntaxError (syntax error, unexpected `true', expecting ')')
//}
Ripper.lex は分割したトークンを詳しい情報とともに返します。
返り値の... -
Ripper
. lex(src , filename = & # 39;-& # 39; , lineno = 1) -> [[Integer , Integer] , Symbol , String , Ripper :: Lexer :: State] (18325.0) -
Ruby プログラム str をトークンに分割し、そのリストを返します。 ただし Ripper.tokenize と違い、トークンの種類と位置情報も付属します。
...ファイル名を文字列で指定します。省略すると "-" になります。
@param lineno src の開始行番号を指定します。省略すると 1 になります。
//emlist[][ruby]{
require 'ripper'
pp Ripper.lex("def m(a) nil end")
# => [[[1, 0], :on_kw, "def", EXPR_FNAME],
#.......lex は分割したトークンを詳しい情報とともに返します。
返り値の配列の要素は 4 要素の配列 (概念的にはタプル) です。
その内訳を以下に示します。
: 位置情報 (Integer,Integer)
トークンが置かれている行 (1-origin) と桁 (0-......です。
: 種類 (Symbol)
トークンの種類が「:on_XXX」の形式のシンボルで渡されます。
: トークン (String)
トークン文字列です。
: ステート (Ripper::Lexer::State)
トークンの状態を表す Ripper::Lexer::State のインスタンスです。......ファイル名を文字列で指定します。省略すると "-" になります。
@param lineno src の開始行番号を指定します。省略すると 1 になります。
//emlist[][ruby]{
require 'ripper'
pp Ripper.lex("def m(a) nil end")
# => [[[1, 0], :on_kw, "def", FNAME],
#... -
Ripper
. lex(src , filename = & # 39;-& # 39; , lineno = 1) -> [[Integer , Integer] , Symbol , String] (18225.0) -
Ruby プログラム str をトークンに分割し、そのリストを返します。 ただし Ripper.tokenize と違い、トークンの種類と位置情報も付属します。
...イル名を文字列で指定します。省略すると "-" になります。
@param lineno src の開始行番号を指定します。省略すると 1 になります。
//emlist[][ruby]{
require 'ripper'
require 'pp'
pp Ripper.lex("def m(a) nil end")
# => [[[1, 0], :on_kw, "def"],
# [[.......lex は分割したトークンを詳しい情報とともに返します。
返り値の配列の要素は 3 要素の配列 (概念的にはタプル) です。
その内訳を以下に示します。
: 位置情報 (Integer,Integer)
トークンが置かれている行 (1-origin) と桁 (0-... -
irb
/ ruby-lex (12000.0) -
Ruby のソースコードを字句解析するためのサブライブラリです。
Ruby のソースコードを字句解析するためのサブライブラリです。
このライブラリで定義されているメソッドはユーザが直接使用するものではありません。 -
Complex
# -@ -> Complex (9218.0) -
自身の符号を反転させたものを返します。
...自身の符号を反転させたものを返します。
//emlist[例][ruby]{
-Complex(1) # => (-1+0i)
-Complex(-1, 1) # => (1-1i)
//}... -
Kernel
. # Complex(r , i = 0) -> Complex (6306.0) -
実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
...実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
@param r 生成する複素数の実部。
@param i 生成する複素数の虚部。省略した場合は 0 です。
@param s 生成する複素数を表す文字列。
@raise ArgumentError 変換......します。
//emlist[例][ruby]{
Complex(1) # => (1+0i)
Complex(1, 2) # => (1+2i)
Complex('1+1i') # => (1+1i)
Complex('1+1j') # => (1+1i)
# Complex.polar(10, 10) と同一。
Complex('10@10') # => (-8.390715290764524-5.440211108893697i)
Complex('_') # => ArgumentError
//}
r にも......omplex(a, b) を a+bi として計算した Complex オブジェクトを返しま
す。
//emlist[例][ruby]{
Complex('1+1i', '2+3i') # => (-2+3i)
Complex('1+1i') + Complex('2+3i') * Complex('i') # => (-2+3i)
//}
@see Complex.rect、Complex.rectangular
[注意] Complex.n... -
Kernel
. # Complex(r , i = 0 , exception: true) -> Complex | nil (6306.0) -
実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
...実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
@param r 生成する複素数の実部。
@param i 生成する複素数の虚部。省略した場合は 0 です。
@param s 生成する複素数を表す文字列。
@param exception false を......します。
//emlist[例][ruby]{
Complex(1) # => (1+0i)
Complex(1, 2) # => (1+2i)
Complex('1+1i') # => (1+1i)
Complex('1+1j') # => (1+1i)
# Complex.polar(10, 10) と同一。
Complex('10@10') # => (-8.390715290764524-5.440211108893697i)
Complex('_') # => ArgumentError
//}
r にも......omplex(a, b) を a+bi として計算した Complex オブジェクトを返しま
す。
//emlist[例][ruby]{
Complex('1+1i', '2+3i') # => (-2+3i)
Complex('1+1i') + Complex('2+3i') * Complex('i') # => (-2+3i)
//}
@see Complex.rect、Complex.rectangular
[注意] Complex.n... -
Kernel
. # Complex(s) -> Complex (6306.0) -
実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
...実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
@param r 生成する複素数の実部。
@param i 生成する複素数の虚部。省略した場合は 0 です。
@param s 生成する複素数を表す文字列。
@raise ArgumentError 変換......します。
//emlist[例][ruby]{
Complex(1) # => (1+0i)
Complex(1, 2) # => (1+2i)
Complex('1+1i') # => (1+1i)
Complex('1+1j') # => (1+1i)
# Complex.polar(10, 10) と同一。
Complex('10@10') # => (-8.390715290764524-5.440211108893697i)
Complex('_') # => ArgumentError
//}
r にも......omplex(a, b) を a+bi として計算した Complex オブジェクトを返しま
す。
//emlist[例][ruby]{
Complex('1+1i', '2+3i') # => (-2+3i)
Complex('1+1i') + Complex('2+3i') * Complex('i') # => (-2+3i)
//}
@see Complex.rect、Complex.rectangular
[注意] Complex.n... -
Kernel
. # Complex(s , exception: true) -> Complex | nil (6306.0) -
実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
...実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
@param r 生成する複素数の実部。
@param i 生成する複素数の虚部。省略した場合は 0 です。
@param s 生成する複素数を表す文字列。
@param exception false を......します。
//emlist[例][ruby]{
Complex(1) # => (1+0i)
Complex(1, 2) # => (1+2i)
Complex('1+1i') # => (1+1i)
Complex('1+1j') # => (1+1i)
# Complex.polar(10, 10) と同一。
Complex('10@10') # => (-8.390715290764524-5.440211108893697i)
Complex('_') # => ArgumentError
//}
r にも......omplex(a, b) を a+bi として計算した Complex オブジェクトを返しま
す。
//emlist[例][ruby]{
Complex('1+1i', '2+3i') # => (-2+3i)
Complex('1+1i') + Complex('2+3i') * Complex('i') # => (-2+3i)
//}
@see Complex.rect、Complex.rectangular
[注意] Complex.n... -
irb
/ slex (6032.0) -
Ruby のソースコードを字句解析するためのサブライブラリです。 irb/ruby-lex から使用されます。
...Ruby のソースコードを字句解析するためのサブライブラリです。
irb/ruby-lex から使用されます。
このライブラリで定義されているメソッドはユーザが直接使用するものではありません。... -
Complex (6024.0)
-
複素数を扱うクラスです。
...Complex オブジェクトを作成するには、Kernel.#Complex、
Complex.rect、Complex.polar、Numeric#to_c、
String#to_c のいずれかを使用します。
//emlist[Complex オブジェクトの作り方][ruby]{
Complex(1) # => (1+0i)
Complex(2, 3) # => (2+3i)
Complex.pol......(-1.9799849932008908+0.2822400161197344i)
Complex(0.3) # => (0.3+0i)
Complex('0.3-0.5i') # => (0.3-0.5i)
Complex('2/3+3/4i') # => ((2/3)+(3/4)*i)
Complex('1@2') # => (-0.4161468365471424+0.9092974268256817i)
3.to_c # => (3+0i)
0.3.to_c # => (0.3+0i)
'0.3-0.......> (0.3-0.5i)
'2/3+3/4i'.to_c # => ((2/3)+(3/4)*i)
'1@2'.to_c # => (-0.4161468365471424+0.9092974268256817i)
//}
Complex オブジェクトは有理数の形式も実数の形式も扱う事ができます。
//emlist[例][ruby]{
Complex(1, 1) / 2 # => ((1/2)+(1/2)*i)
Complex(1, 1... -
Complex
# coerce(other) -> [Complex , Complex] (3300.0) -
other を Complex に変換して [変換後の other, self] の配列を返します。
...other を Complex に変換して [変換後の other, self] の配列を返します。
@raise TypeError 変換できないオブジェクトを指定した場合に発生します。
//emlist[例][ruby]{
Complex(1).coerce(2) # => [(2+0i), (1+0i)]
//}...