162件ヒット
[1-100件を表示]
(0.103秒)
ライブラリ
- ビルトイン (96)
- date (22)
-
fiddle
/ import (22) - set (22)
モジュール
-
Fiddle
:: Importer (22)
検索結果
先頭5件
-
Time
# sec -> Integer (18214.0) -
秒を整数で返します。
...秒を整数で返します。
//emlist[][ruby]{
p Time.mktime(2000, 1, 1).sec # => 0
//}
通常は0から59を返しますが、うるう秒の場合は60を返します。
//emlist[][ruby]{
ENV['TZ'] = 'right/UTC'
p Time.mktime(2005, 12, 31, 23, 59, 60).sec # => 60
//}... -
DateTime
# sec -> Integer (18202.0) -
秒を返します (0-59)。
秒を返します (0-59)。 -
Array
# intersect?(other) -> bool (12201.0) -
other と共通の要素が少なくとも1個あれば true を、なければ false を返します。
...other と共通の要素が少なくとも1個あれば true を、なければ false を返します。
//emlist[例][ruby]{
a = [ 1, 2, 3 ]
b = [ 3, 4, 5 ]
c = [ 5, 6, 7 ]
a.intersect?(b) # => true
a.intersect?(c) # => false
//}... -
Array
# intersection(*other _ arrays) -> Array (12201.0) -
自身と引数に渡された配列の共通要素を新しい配列として返します。 要素が重複する場合は、そのうちの1つのみを返します。 要素の順序は自身の順序を維持します。
...場合に発生します。
intersectionはObject#hashとObject#eql?を使って比較を行います。
//emlist[例][ruby]{
[1, 1, 3, 5].intersection([3, 2, 1]) # => [1, 3]
["a", "b", "z"].intersection(["a", "b", "c"], ["b"]) # => ["b"]
["a"].intersection......# => ["a"]
//}
@see Set#intersection, Array#&... -
Set
# intersect?(set) -> bool (12201.0) -
self と set の共通要素がある場合に true を返します。
...ram self Set オブジェクトを指定します。
@raise ArgumentError 引数が Set オブジェクトでない場合に発生します。
require 'set'
p Set[1, 2, 3].intersect?(Set[3, 4]) # => true
p Set[1, 2, 3].intersect?(Set[4, 5]) # => false
@see Set#intersection, Set#disjoint?... -
DateTime
# second -> Integer (6202.0) -
秒を返します (0-59)。
秒を返します (0-59)。 -
Set
# intersection(enum) -> Set (6201.0) -
共通部分、すなわち、2つの集合のいずれにも属するすべての要素からなる 新しい集合を作ります。
共通部分、すなわち、2つの集合のいずれにも属するすべての要素からなる
新しい集合を作ります。
@param enum each メソッドが定義されたオブジェクトを指定します。
@raise ArgumentError 引数 enum に each メソッドが定義されていない場合に
発生します。
//emlist[][ruby]{
require 'set'
s1 = Set[10, 20, 30]
s2 = Set[10, 30, 50]
p s1 & s2 #=> #<Set: {10, 30}>
//}
@see Array#&...ブジェクトを指定します。
@raise ArgumentError 引数 enum に each メソッドが定義されていない場合に
発生します。
//emlist[][ruby]{
require 'set'
s1 = Set[10, 20, 30]
s2 = Set[10, 30, 50]
p s1 & s2 #=> #<Set: {10, 30}>
//}
@see Array#&, Array#intersection... -
Time
# nsec -> Integer (6201.0) -
時刻のナノ秒の部分を整数で返します。
...Time.local(2000,1,2,3,4,5,6)
p "%10.9f" % t.to_f # => "946749845.000005960"
p t.nsec # => 6000
//}
IEEE 754 浮動小数点数で表現できる精度が違うため、Time#to_fの最小
の桁とnsecの最小の桁は異なります。nsecで表される値の方が正確です。... -
Time
# subsec -> Integer | Rational (6201.0) -
時刻を表す分数を返します。
...=> "946749845.000005960"
p t.subsec #=> (3/500000)
//}
to_f の値と subsec の値の下のほうの桁の値は異なる場合があります。
というのは IEEE 754 double はそれを表すのに十分な精度を
持たないからです。subsec で得られる値が正確で... -
Time
# tv _ nsec -> Integer (6201.0) -
時刻のナノ秒の部分を整数で返します。
...Time.local(2000,1,2,3,4,5,6)
p "%10.9f" % t.to_f # => "946749845.000005960"
p t.nsec # => 6000
//}
IEEE 754 浮動小数点数で表現できる精度が違うため、Time#to_fの最小
の桁とnsecの最小の桁は異なります。nsecで表される値の方が正確です。... -
Time
# tv _ usec -> Integer (6201.0) -
時刻のマイクロ秒の部分を整数で返します。
...時刻のマイクロ秒の部分を整数で返します。
//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5,6)
p "%10.6f" % t.to_f #=> "946749845.000006"
p t.usec #=> 6
//}...