るりまサーチ

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

検索結果

Time#tv_nsec -> Integer (23102.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の最小の桁は異なり...

Time#nsec -> Integer (8002.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の最小の桁は異なり...