るりまサーチ

最速Rubyリファレンスマニュアル検索!
110件ヒット [1-100件を表示] (0.041秒)

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

クラス

モジュール

キーワード

検索結果

<< 1 2 > >>

Time#to_f -> Float (27115.0)

起算時からの経過秒数を浮動小数点数で返します。1 秒に満たない経過も 表現されます。

...らの経過秒数を浮動小数点数で返します。1 秒に満たない経過も
表現されます。

//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5,6)
p t # => 2000-01-02 03:04:05 +0900
p "%10.6f" % t.to_f # => "946749845.000006"
p t.to_i # => 946749845
//}...

Time#nsec -> Integer (9026.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#tv_nsec -> Integer (9026.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#subsec -> Integer | Rational (9020.0)

時刻を表す分数を返します。

...数を返します。

Rational を返す場合があります。

//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5,6)
p "%10.9f" % t.to_f # => "946749845.000005960"
p t.subsec #=> (3/500000)
//}

to_f
の値と subsec の値の下のほうの桁の値は異なる場合があります。...

Time#to_i -> Integer (9014.0)

起算時からの経過秒数を整数で返します。

...起算時からの経過秒数を整数で返します。

//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5,6)
p t # => 2000-01-02 03:04:05 +0900
p "%10.6f" % t.to_f # => "946749845.000006"
p t.to_i # => 946749845
p t.tv_sec # => 946749845
//}...

絞り込み条件を変える

Time#tv_sec -> Integer (9014.0)

起算時からの経過秒数を整数で返します。

...起算時からの経過秒数を整数で返します。

//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5,6)
p t # => 2000-01-02 03:04:05 +0900
p "%10.6f" % t.to_f # => "946749845.000006"
p t.to_i # => 946749845
p t.tv_sec # => 946749845
//}...

Time#tv_usec -> Integer (9014.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
//}...

Time#usec -> Integer (9014.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
//}...

File::Stat#ctime -> Time (6215.0)

最終状態変更時刻を返します。 (状態の変更とは chmod などによるもので、Unix では i-node の変更を意味します)

...最終状態変更時刻を返します。
(状態の変更とは chmod などによるもので、Unix では i-node の変更を意味します)

//emlist[][ruby]{
fs = File::Stat.new($0)
#例
p fs.ctime.to_f #=> 1188719843.0
//}


@see Time...

Kernel.#Float(arg) -> Float (32.0)

引数を浮動小数点数(Float)に変換した結果を返します。

...し String#to_f よりも厳密な変換を行います。

@param arg 変換対象のオブジェクトです。
@raise ArgumentError 整数や浮動小数点数と見なせない文字列を引数に指定した場合に発生します。
@raise TypeError nil またはメソッド to_f を持た...
...ェクトを引数に指定したか、
to_f
が浮動小数点数を返さなかった場合に発生します。

//emlist[例][ruby]{
p Float(4) #=> 4.0
p Float(4_000) #=> 4000.0
p Float(9.88) #=> 9.88

p Float(Time.gm(1986)) #=> 504921600.0
p Float(Obje...
...alid value for Float(): "0xa.a" (ArgumentError)
p Float(" \n10\s \t") #=> 10.0 # 先頭と末尾の空白類は無視される
p Float("1\n0") # invalid value for Float(): "1\n0" (ArgumentError)
p Float("") # invalid value for Float(): "" (ArgumentError)
//}

@see String#to_f,Float...

絞り込み条件を変える

<< 1 2 > >>