273件ヒット
[201-273件を表示]
(0.059秒)
クラス
検索結果
先頭5件
-
String
# hex -> Integer (9.0) -
文字列に 16 進数で数値が表現されていると解釈して整数に変換します。 接頭辞 "0x", "0X" とアンダースコアは無視されます。 文字列が [_0-9a-fA-F] 以外の文字を含むときはその文字以降を無視します。
...x10".hex # => -16
p "xyz".hex # => 0
p "10z".hex # => 16
p "1_0".hex # => 16
p "".hex # => 0
//}
@see String#oct, String#to_i, String#to_f,
Kernel.#Integer, Kernel.#Float
このメソッドの逆に数値を文字列に変換するには
Kernel.#sprintf, String#%,
Integer#to_s... -
String
# oct -> Integer (9.0) -
文字列を 8 進文字列であると解釈して、整数に変換します。
...y]{
p "-010".oct # => -8
p "-0x10".oct # => -16
p "-0b10".oct # => -2
p "1_0_1x".oct # => 65
//}
@see String#hex, String#to_i, String#to_f,
Kernel.#Integer, Kernel.#Float
逆に、数値を文字列に変換するにはKernel.#sprintf,
String#%, Integer#to_s を使用します。... -
String
# to _ i(base = 10) -> Integer (9.0) -
文字列を 10 進数表現された整数であると解釈して、整数に変換します。
...する整数。0 か、2〜36 の整数。
@return 整数
このメソッドの逆に数値を文字列に変換するには、
Kernel.#sprintf, String#%, Integer#to_s
を使用します。
String#hex, String#oct, String#to_f,
Kernel.#Integer, Kernel.#Float
も参照してください。... -
Time
# to _ i -> Integer (9.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 (9.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 (9.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 (9.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
//}...