るりまサーチ

最速Rubyリファレンスマニュアル検索!
77件ヒット [1-77件を表示] (0.020秒)
トップページ > クエリ:|[x] > クエリ:abs[x]

別のキーワード

  1. _builtin |
  2. ipaddr |
  3. set |
  4. array |
  5. nilclass |

ライブラリ

キーワード

検索結果

Bignum#abs -> Fixnum | Bignum (18203.0)

self の絶対値を返します。

self の絶対値を返します。

Fixnum#abs -> Fixnum | Bignum (18203.0)

self の絶対値を返します。

self の絶対値を返します。

RubyVM::InstructionSequence#absolute_path -> String | nil (6201.0)

self が表す命令シーケンスの絶対パスを返します。

...piled>@<compiled>>
iseq.absolute_path
# => nil

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/method.rb
def hello
puts "hello, world"
end

# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.absolute_path # => "/tmp/meth...

Thread::Backtrace::Location#absolute_path -> String (6112.0)

self が表すフレームの絶対パスを返します。

...][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end

Foo.new(0..2).locations.map do |call|
puts call.absolute_path
end

# => /path/to/foo.rb
# /path/to/foo.rb
# /path/to/foo.rb
//}

@see Thread::Backtrace::Location#path...

Bignum#magnitude -> Fixnum | Bignum (3103.0)

self の絶対値を返します。

self の絶対値を返します。

絞り込み条件を変える

Fixnum#magnitude -> Fixnum | Bignum (3103.0)

self の絶対値を返します。

self の絶対値を返します。

Numeric (600.0)

数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。

...% | o - o o o - -
& | - - o o - - -
* | - - o o o o o
** |...
...+ | - - o o o o o
+@ | o - - - - - -
- | - - o o o o o
-@ |...
...---------------------------------------
abs
| o - o o o - o
abs
2 | o - - - - - o
angle | o - - -...
...------
% | o o o - -
& | - o - - -
* | - o o o o
** | - o o...
...o
+ | - o o o o
+@ | o - - - -
- | - o o o o
-@ | o o o...
...-
^ | - o - - -
Numeric Integer Float Rational Complex
--------------------------------------------------------------------------------
abs
| o o o...

Set#divide {|o1, o2| ... } -> Set (144.0)

元の集合をブロックで定義される関係で分割し、その結果を集合として返します。

...'set'
numbers = Set.new(1..6)
set = numbers.divide {|i| i % 3}
p set
# => #<Set: {#<Set: {1, 4}>, #<Set: {2, 5}>, #<Set: {3, 6}>}>
//}

//emlist[例2][ruby]{
require 'set'
numbers = Set[1, 3, 4, 6, 9, 10, 11]
set = numbers.divide {|i, j| (i - j).abs == 1}
p set # => #<Set: {#<Set: {1}>,...
...board = Set.new
m, n = 8, 2
for i in 1..m
for j in 1..n
board << [i,j]
end
end
knight_move = Set[1,2]
p board.divide { |i,j|
Set[(i[0] - j[0]).abs, (i[1] - j[1]).abs] == knight_move
}
# => #<Set: {#<Set: {[1, 1], [3, 2], [5, 1], [7, 2]}>,
# #<Set: {[1, 2], [3, 1], [5, 2], [7, 1]...
...例1][ruby]{
numbers = Set.new(1..6)
set = numbers.divide {|i| i % 3}
p set
# => #<Set: {#<Set: {1, 4}>, #<Set: {2, 5}>, #<Set: {3, 6}>}>
//}

//emlist[例2][ruby]{
numbers = Set[1, 3, 4, 6, 9, 10, 11]
set = numbers.divide {|i, j| (i - j).abs == 1}
p set # => #<Set: {#<Set: {1}>,
#...

Set#divide {|o| ... } -> Set (144.0)

元の集合をブロックで定義される関係で分割し、その結果を集合として返します。

...'set'
numbers = Set.new(1..6)
set = numbers.divide {|i| i % 3}
p set
# => #<Set: {#<Set: {1, 4}>, #<Set: {2, 5}>, #<Set: {3, 6}>}>
//}

//emlist[例2][ruby]{
require 'set'
numbers = Set[1, 3, 4, 6, 9, 10, 11]
set = numbers.divide {|i, j| (i - j).abs == 1}
p set # => #<Set: {#<Set: {1}>,...
...board = Set.new
m, n = 8, 2
for i in 1..m
for j in 1..n
board << [i,j]
end
end
knight_move = Set[1,2]
p board.divide { |i,j|
Set[(i[0] - j[0]).abs, (i[1] - j[1]).abs] == knight_move
}
# => #<Set: {#<Set: {[1, 1], [3, 2], [5, 1], [7, 2]}>,
# #<Set: {[1, 2], [3, 1], [5, 2], [7, 1]...
...例1][ruby]{
numbers = Set.new(1..6)
set = numbers.divide {|i| i % 3}
p set
# => #<Set: {#<Set: {1, 4}>, #<Set: {2, 5}>, #<Set: {3, 6}>}>
//}

//emlist[例2][ruby]{
numbers = Set[1, 3, 4, 6, 9, 10, 11]
set = numbers.divide {|i, j| (i - j).abs == 1}
p set # => #<Set: {#<Set: {1}>,
#...

NEWS for Ruby 3.0.0 (12.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...osplatting. This now matches the behavior of Procs
accepting a single rest argument and no keywords.
16166

//emlist[][ruby]{
pr = proc{|*a, **kw| [a, kw]}

pr.call([1])
# 2.7 => [[1], {}]
# 3.0 => [[[1]], {}]

pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 =>...
...and their subclasses.
* Method inlining support for some C methods
* `Kernel`: `#class`, `#frozen?`
* `Integer`: `#-@`, `#~`, `#abs`, `#bit_length`, `#even?`, `#integer?`, `#magnitude`, `#odd?`, `#ord`, `#to_i`, `#to_int`, `#zero?`
* `Struct`: reader methods for 10th or...
...e/stdlib classes.
* `rbs` gem is bundled to load and process RBS files.

=== TypeProf

* TypeProf is a type analysis tool for Ruby code based on abstract interpretation.
* It reads non-annotated Ruby code, tries inferring its type signature, and prints the analysis result in RBS format....

絞り込み条件を変える