183件ヒット
[1-100件を表示]
(0.127秒)
別のキーワード
ライブラリ
- ビルトイン (135)
- bigdecimal (12)
-
irb
/ cmd / subirb (12) -
irb
/ context (12) - resolv (12)
クラス
- BigDecimal (12)
- Bignum (3)
-
IRB
:: Context (12) -
IRB
:: ExtendCommand :: IrbCommand (12) - Integer (12)
- Module (24)
- Numeric (12)
-
Resolv
:: DNS :: Name (12) -
RubyVM
:: InstructionSequence (36) - Thread (24)
-
Thread
:: Backtrace :: Location (24)
キーワード
- autoload (12)
-
backtrace
_ locations (24) -
base
_ label (24) - execute (12)
- label (12)
- remainder (39)
-
subdomain
_ of? (12) -
to
_ a (12) -
to
_ s (12) - using (12)
検索結果
先頭5件
-
IRB
:: Context # main -> object (18118.0) -
self に設定されたオブジェクトを返します。
...
self に設定されたオブジェクトを返します。
@see cwws コマンド... -
Numeric
# remainder(other) -> Numeric (6147.0) -
self を other で割った余り r を返します。
...
self を other で割った余り r を返します。
ここで、商 q と余り r は、
* self == other * q + r
と
* self > 0 のとき 0 <= r < |other|
* self < 0 のとき -|other| < r <= 0
* q は整数
をみたす数です。r の符号は self と同じになります。......りません。self.quo(other).truncate がそれに相当します。
@param other 自身を割る数を指定します。
//emlist[例][ruby]{
p 13.remainder(4) #=> 1
p (11.5).remainder(3.5) #=> 1.0
p 13.remainder(-4) #=> 1
p (-13).remainder(4) #=> -1
p (-13).remainder(-4) #=>... -
BigDecimal
# remainder(n) -> BigDecimal (6129.0) -
self を n で割った余りを返します。
...
self を n で割った余りを返します。
@param n self を割る数を指定します。
//emlist[][ruby]{
require 'bigdecimal'
x = BigDecimal((2**100).to_s)
x.remainder(3).to_i # => 1
(-x).remainder(3).to_i # => -1
x.remainder(-3).to_i # => 1
(-x).remainder(-3).to_i # => -1
//}......戻り値は self と同じ符号になります。これは BigDecimal#% とは異な
る点に注意してください。詳細は Numeric#%、
Numeric#remainder を参照して下さい。... -
Bignum
# remainder(other) -> Fixnum | Bignum | Float (6129.0) -
self を other で割った余り r を返します。
...
self を other で割った余り r を返します。
r の符号は self と同じになります。
@param other self を割る数。
@see Bignum#divmod, Bignum#modulo, Numeric#modulo... -
Integer
# remainder(other) -> Numeric (6129.0) -
self を other で割った余り r を返します。
...
self を other で割った余り r を返します。
r の符号は self と同じになります。
@param other self を割る数。
//emlist[][ruby]{
5.remainder(3) # => 2
-5.remainder(3) # => -2
5.remainder(-3) # => 2
-5.remainder(-3) # => -2
-1234567890987654321.remainder(13731......) # => -6966
-1234567890987654321.remainder(13731.24) # => -9906.22531493148
//}
@see Integer#divmod, Integer#modulo, Numeric#modulo... -
Resolv
:: DNS :: Name # subdomain _ of?(other) -> bool (6117.0) -
other が self のサブドメインであるかどうかを返します。
...other が self のサブドメインであるかどうかを返します。
//emlist[][ruby]{
require "resolv"
domain = Resolv::DNS::Name.create("y.z")
p Resolv::DNS::Name.create("w.x.y.z").subdomain_of?(domain) #=> true
p Resolv::DNS::Name.create("x.y.z").subdomain_of?(domain) #=> true
p Resolv::D......NS::Name.create("y.z").subdomain_of?(domain) #=> false
p Resolv::DNS::Name.create("z").subdomain_of?(domain) #=> false
p Resolv::DNS::Name.create("x.y.z.").subdomain_of?(domain) #=> false
p Resolv::DNS::Name.create("w.z").subdomain_of?(domain) #=> false
//}... -
Module
# using(module) -> self (108.0) -
引数で指定したモジュールで定義された拡張を現在のクラス、モジュールで有 効にします。
...ルで有
効にします。
有効にした拡張の有効範囲については以下を参照してください。
* https://docs.ruby-lang.org/en/master/syntax/refinements_rdoc.html#label-Scope
@param module 有効にするモジュールを指定します。
@see Module#refine, main.using... -
RubyVM
:: InstructionSequence # label -> String (35.0) -
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。
...
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、
モジュール名などで構成されます。
トップレベルでは "<main>" を返します。self を文字列から作成していた場合
は "<compiled>" を返します。
例1......d.rb
def hello
puts "hello, world"
end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.label # => "<main>"
例3:
# /tmp/method2.rb
def hello
puts "hello, world"
end
RubyVM::InstructionSequence.of(method(:hello)).label
# => "hello"
@se... -
RubyVM
:: InstructionSequence # to _ a -> Array (29.0) -
self の情報を 14 要素の配列にして返します。
...
self の情報を 14 要素の配列にして返します。
命令シーケンスを以下の情報で表します。
: magic
データフォーマットを示す文字列。常に
"YARVInstructionSequence/SimpleDataFormat"。
: major_version
命令シーケンスのメジャーバー......bel
メソッド名、クラス名、モジュール名などで構成される命令シーケンスのラ
ベル。トップレベルでは "<main>"。文字列から作成していた場合は
"<compiled>"。
: #path
命令シーケンスの相対パス。文字列から作成してい......ケンスの 1 行目の行番号。
: type
命令シーケンスの種別。
:top、:method、:block、:class、:rescue、:ensure、:eval、:main、
:defined_guard のいずれか。
: locals
全ての引数名、ローカル変数名からなる Symbol の配列。
: args
引数の... -
RubyVM
:: InstructionSequence # base _ label -> String (23.0) -
self が表す命令シーケンスの基本ラベルを返します。
...
self が表す命令シーケンスの基本ラベルを返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.base_label
# => "<compiled>"
例2: RubyVM::InstructionSequence.co......def hello
puts "hello, world"
end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.base_label # => "<main>"
例3:
# /tmp/method2.rb
def hello
puts "hello, world"
end
RubyVM::InstructionSequence.of(method(:hello)).base_label
# => "hello"...