るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.043秒)
トップページ > バージョン:2.3.0[x] > クエリ:Integer[x] > クエリ:int[x] > クエリ:nsec[x]

別のキーワード

  1. openssl integer
  2. asn1 integer
  3. _builtin integer
  4. integer times
  5. integer new

ライブラリ

クラス

検索結果

Time#nsec -> Integer (54967.0)

時刻のナノ秒の部分を整数で返します。

時刻のナノ秒の部分を整数で返します。

//emlist[][ruby]{
t = 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_nsec -> Integer (18967.0)

時刻のナノ秒の部分を整数で返します。

時刻のナノ秒の部分を整数で返します。

//emlist[][ruby]{
t = 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で表される値の方が正確です。