ライブラリ
- ビルトイン (339)
- bigdecimal (12)
-
minitest
/ unit (1) - pathname (12)
-
rdoc
/ text (12) -
rdoc
/ top _ level (24) - resolv (24)
- set (18)
- uri (24)
-
webrick
/ httpserver (24) -
webrick
/ httpservlet / abstract (120)
クラス
- BigDecimal (12)
- Bignum (6)
- Complex (36)
- File (18)
- Fixnum (6)
- Float (24)
- Integer (24)
- Numeric (36)
- Object (36)
- Pathname (12)
-
RDoc
:: TopLevel (24) - Rational (18)
-
Resolv
:: DNS :: Name (24) -
RubyVM
:: AbstractSyntaxTree :: Node (49) -
RubyVM
:: InstructionSequence (12) - Set (24)
-
Thread
:: Backtrace :: Location (12) -
URI
:: Generic (24) -
WEBrick
:: HTTPServer :: MountTable (24) -
WEBrick
:: HTTPServlet :: AbstractServlet (108)
モジュール
-
MiniTest
:: Assertions (1) -
RDoc
:: Text (12) -
RubyVM
:: AbstractSyntaxTree (30)
キーワード
- AbstractServlet (12)
- AbstractSyntaxTree (7)
-
NEWS for Ruby 3
. 0 . 0 (5) - Node (7)
- Numeric (12)
- [] (12)
- abs2 (24)
- absolute (12)
- absolute? (36)
-
absolute
_ path (36) -
absolute
_ path? (6) -
assert
_ in _ epsilon (1) - children (7)
- delete (12)
- divide (24)
-
do
_ DELETE (12) -
do
_ GET (12) -
do
_ HEAD (12) -
do
_ OPTIONS (12) -
do
_ POST (12) -
do
_ PUT (12) -
file
_ absolute _ name (12) -
file
_ absolute _ name= (12) -
first
_ column (7) -
first
_ lineno (7) -
get
_ instance (12) - inspect (7)
-
last
_ column (7) -
last
_ lineno (7) - magnitude (63)
- method (12)
- new (24)
- of (10)
- parse (10)
-
parse
_ file (10) - send (24)
- service (12)
- type (7)
-
webrick
/ httpservlet / abstract (12)
検索結果
先頭5件
-
Complex
# abs -> Numeric (18125.0) -
自身の絶対値を返します。
...す。
以下の計算の結果を Float オブジェクトで返します。
sqrt(self.real ** 2 + self.imag ** 2)
//emlist[例][ruby]{
Complex(1, 2).abs # => 2.23606797749979
Complex(3, 4).abs # => 5.0
Complex('1/2', '1/2').abs # => 0.7071067811865476
//}
@see Complex#abs2... -
Integer
# abs -> Integer (18119.0) -
self の絶対値を返します。
...self の絶対値を返します。
//emlist[][ruby]{
-12345.abs # => 12345
12345.abs # => 12345
-1234567890987654321.abs # => 1234567890987654321
//}... -
Numeric
# abs -> Numeric (18119.0) -
自身の絶対値を返します。
...自身の絶対値を返します。
//emlist[例][ruby]{
12.abs #=> 12
(-34.56).abs #=> 34.56
-34.56.abs #=> 34.56
//}... -
BigDecimal
# abs -> BigDecimal (18113.0) -
self の絶対値を返します。
...self の絶対値を返します。
//emlist[][ruby]{
require 'bigdecimal'
BigDecimal('5').abs.to_i # => 5
BigDecimal('-3').abs.to_i # => 3
//}... -
Float
# abs -> Float (18113.0) -
自身の絶対値を返します。
...自身の絶対値を返します。
//emlist[例][ruby]{
34.56.abs # => 34.56
-34.56.abs # => 34.56
//}... -
Rational
# abs -> Rational (18113.0) -
自身の絶対値を返します。
...自身の絶対値を返します。
//emlist[例][ruby]{
Rational(1, 2).abs # => (1/2)
Rational(-1, 2).abs # => (1/2)
//}... -
Bignum
# abs -> Fixnum | Bignum (18101.0) -
self の絶対値を返します。
self の絶対値を返します。 -
Fixnum
# abs -> Fixnum | Bignum (18101.0) -
self の絶対値を返します。
self の絶対値を返します。 -
Complex
# abs2 -> Numeric (6125.0) -
自身の絶対値の 2 乗を返します。
...自身の絶対値の 2 乗を返します。
以下の計算の結果を返します。
self.real ** 2 + self.imag ** 2
//emlist[例][ruby]{
Complex(1, 1).abs2 # => 2
Complex(1.0, 1.0).abs2 # => 2.0
Complex('1/2', '1/2').abs2 # => (1/2)
//}
@see Complex#abs... -
Numeric
# abs2 -> Numeric (6125.0) -
自身の絶対値の 2 乗を返します。
...自身の絶対値の 2 乗を返します。
//emlist[例][ruby]{
2.abs2 # => 4
-2.abs2 # => 4
2.0.abs2 # => 4
-2.0.abs2 # => 4
//}
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。... -
File
. absolute _ path(file _ name , dir _ string=nil) -> String (6100.0) -
file_name を絶対パスに変換した文字列を返します。
...work/bar"
p ENV["HOME"] #=> "/home/matz"
p File.absolute_path("..") #=> "/home/matz/work"
p File.absolute_path("..", "/tmp") #=> "/"
p File.absolute_path("~") #=> "/home/matz/work/bar/~"
p File.absolute_path("~foo") #=> "/home/matz/work/bar/~foo"
//}
@see F...