るりまサーチ

最速Rubyリファレンスマニュアル検索!
98件ヒット [1-98件を表示] (0.052秒)
トップページ > クエリ:kernel[x] > クエリ:convert[x] > クエリ:Integer[x]

別のキーワード

  1. kernel system
  2. kernel exec
  3. kernel spawn
  4. kernel open
  5. kernel caller

ライブラリ

クラス

モジュール

検索結果

Kernel.#Integer(arg, base = 0) -> Integer (27370.0)

引数を整数 (Fixnum,Bignum) に変換した結果を返します。

...(Integerのサブクラス)を返さなかった場合に発生します。
@raise TypeError 引数に nil を指定した場合に発生します。

//emlist[例][ruby]{
p Integer(4) #=> 4
p Integer(4_000) #=> 4000
p Integer(9.88) #=> 9

p Integer(nil) # can't convert ni...
...l into Integer (TypeError)
p Integer(Object.new) # cannot convert Object into Integer (TypeError)

p Integer("10") #=> 10
p Integer("10", 2) #=> 2
p Integer("0d10") #=> 10
p Integer("010") #=> 8
p Integer("0o10") #=> 8
p Integer("0x10") #=> 16
p Integer("0b10") #=> 2
p...
...尾の空白類は無視される
p Integer("1\n0") # `Integer': invalid value for Integer: "1\n0" (ArgumentError)
p Integer("hoge") # `Integer': invalid value for Integer: "hoge" (ArgumentError)
p Integer("") # `Integer': invalid value for Integer: "" (ArgumentError)
//}

@see Strin...

Kernel.#Integer(arg, base = 0, exception: true) -> Integer | nil (27370.0)

引数を整数 (Fixnum,Bignum) に変換した結果を返します。

...(Integerのサブクラス)を返さなかった場合に発生します。
@raise TypeError 引数に nil を指定した場合に発生します。

//emlist[例][ruby]{
p Integer(4) #=> 4
p Integer(4_000) #=> 4000
p Integer(9.88) #=> 9

p Integer(nil) # can't convert ni...
...l into Integer (TypeError)
p Integer(Object.new) # cannot convert Object into Integer (TypeError)

p Integer("10") #=> 10
p Integer("10", 2) #=> 2
p Integer("0d10") #=> 10
p Integer("010") #=> 8
p Integer("0o10") #=> 8
p Integer("0x10") #=> 16
p Integer("0b10") #=> 2
p...
...尾の空白類は無視される
p Integer("1\n0") # `Integer': invalid value for Integer: "1\n0" (ArgumentError)
p Integer("hoge") # `Integer': invalid value for Integer: "hoge" (ArgumentError)
p Integer("") # `Integer': invalid value for Integer: "" (ArgumentError)
//}

@see Strin...

Kernel#convertible_int(type, headers = nil, opts = nil) (15164.0)

Returns the convertible integer type of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. _Convertible_ means actually same type, or typedefed from same type. If the +type+ is a integer type and _convertible_ type is found, following macros are passed as preprocessor constants to the compiler using the +type+ name, in uppercase. * 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X' is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP, where 'TYP' is the +type+ name in uppercase with replacing '_t' suffix with 'T', followed by '=X' where 'X' is the macro name to convert +type+ to +Integer+ object, and vice versa. For example, if foobar_t is defined as unsigned long, then convertible_int("foobar_t") would return "unsigned long", and define macros: #define TYPEOF_FOOBAR_T unsigned long #define FOOBART2NUM ULONG2NUM #define NUM2FOOBART NUM2ULONG

...Returns the convertible integer type of the given +type+. You may
optionally specify additional +headers+ to search in for the +type+.
_Convertible_ means actually same type, or typedefed from same type.

If the +type+ is a integer type and _convertible_ type is found,
following macros are p...
...ollowed by '=X' where 'X'
is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP,
where 'TYP' is the +type+ name in uppercase with replacing '_t'
suffix with 'T', followed by '=X' where 'X' is the macro name to
convert
+type+ to +Integer+ object, and vice versa.

For example,...
...if foobar_t is defined as unsigned long, then
convert
ible_int("foobar_t") would return "unsigned long", and define
macros:

#define TYPEOF_FOOBAR_T unsigned long
#define FOOBART2NUM ULONG2NUM
#define NUM2FOOBART NUM2ULONG...

Kernel#convertible_int(type, headers = nil, opts = nil) { ... } (15164.0)

Returns the convertible integer type of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. _Convertible_ means actually same type, or typedefed from same type. If the +type+ is a integer type and _convertible_ type is found, following macros are passed as preprocessor constants to the compiler using the +type+ name, in uppercase. * 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X' is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP, where 'TYP' is the +type+ name in uppercase with replacing '_t' suffix with 'T', followed by '=X' where 'X' is the macro name to convert +type+ to +Integer+ object, and vice versa. For example, if foobar_t is defined as unsigned long, then convertible_int("foobar_t") would return "unsigned long", and define macros: #define TYPEOF_FOOBAR_T unsigned long #define FOOBART2NUM ULONG2NUM #define NUM2FOOBART NUM2ULONG

...Returns the convertible integer type of the given +type+. You may
optionally specify additional +headers+ to search in for the +type+.
_Convertible_ means actually same type, or typedefed from same type.

If the +type+ is a integer type and _convertible_ type is found,
following macros are p...
...ollowed by '=X' where 'X'
is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP,
where 'TYP' is the +type+ name in uppercase with replacing '_t'
suffix with 'T', followed by '=X' where 'X' is the macro name to
convert
+type+ to +Integer+ object, and vice versa.

For example,...
...if foobar_t is defined as unsigned long, then
convert
ible_int("foobar_t") would return "unsigned long", and define
macros:

#define TYPEOF_FOOBAR_T unsigned long
#define FOOBART2NUM ULONG2NUM
#define NUM2FOOBART NUM2ULONG...

Kernel.#putc(ch) -> object (9012.0)

文字 ch を 標準出力 $stdout に出力します。

...se TypeError Integer に変換できないオブジェクトを引数に
指定した場合に発生します。

//emlist[例][ruby]{
putc("ch")
putc(?c)
putc(99)
putc(355)
#=> cccc

putc(99.00) #=> c
putc(33333333333333333333333333333333333) # bignum too big to convert into `long'...

絞り込み条件を変える

CSV::Converters -> Hash (6136.0)

このハッシュは名前でアクセスできる組み込みの変換器を保持しています。

...保持しています。

CSV#convert で使用する変換器として使用できます。
また CSV.new のオプションとして使用することもできます。

: :integer
Kernel
.#Integer を使用してフィールドを変換します。
: :float
Kernel
.#Float を使用してフィ...
...ールドを変換します。
: :numeric
:integer と :float の組み合わせです。
: :date
Date.parse を使用してフィールドを変換します。
: :date_time
DateTime.parse を使用してフィールドを変換します。
: :all
:date_time と :numeric の組み合わせ...

NEWS for Ruby 2.5.0 (108.0)

NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

... Integer
* Integer#round, Integer#floor, Integer#ceil, Integer#truncate は常に Integer を返すようになりました
13420
* Integer#pow を追加 12508 11003
* Integer#allbits?, Integer#anybits?, Integer#nobits? を追加 12753
* Integer.sqrt を追加 13219

* Kernel...
...* Object#yield_self を追加 6721
* Kernel.#pp をrequireなしで使えるようにしました 14123
* Kernel.#warn :uplevel というキーワード引数を追加しました 12882

* Method
* Method#=== は Proc#===と同じようにMethod#callを呼び出します 14142...
....1.0"セクションにあります。

* pathname
* Pathname#glob を追加 7360

* psych
* Psych 3.0.2 に更新しました
* Convert fallback option to a keyword argument
https://github.com/ruby/psych/pull/342
* Add :symbolize_names option to Psych.load, Psych.saf...

NEWS for Ruby 3.1.0 (66.0)

NEWS for Ruby 3.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...l_time が計測された時間をナノ秒で返します。 10917

* Integer
* 新規メソッド
* Integer.try_convert が追加されました。 15211

* Kernel
* 変更されたメソッド
* Kernel#load が第2引数にモジュールを渡せるようになり、渡...
...した。これは fork(2) のコアメソッドです。このメソッドを直接呼び出さないでください。既存のforkメソッド(Kernel.#fork、Process.fork、IO.popen("-"))によって呼び出されます。アプリケーションモニタリングライブラリは、このメ...
...り厳密に整数に変換されるようになりました。

//emlist[Time.new][ruby]{
Time.new(2021, 12, 25, "+07:30")
#=> invalid value for Integer(): "+07:30" (ArgumentError)
//}

* Ruby 3.0 以前では、予期しない結果の 2021-12-25 07:00:00 が返されました。 2021-12-25...

ruby 1.9 feature (48.0)

ruby 1.9 feature ruby version 1.9.0 は開発版です。 以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。 1.9.1 以降は安定版です。 バグ修正がメインになります。

...の文字列に対し、その文字のコードを返すメソッドが追加されました
: string[integer] が 1文字の String を返すようになりました
: string.slice(integer) が 1文字の String を返すようになりました
: ?c が 1文字の String を返すように...
.../Maker [lib] [new]

((<Imageモジュール|URL:http://web.resource.org/rss/1.0/modules/image/>))のサポート

=== 2005-02-03

: RSS::Element#convert(value) [lib] [new]
valueのエンコーディングを変換するメソッドを公開。

valueのエンコーディングは要素の...
...#=> ruby 1.9.0 (2004-04-25) [i386-mswin32]
["{"]

=== 2004-04-08
: Iconv.list [lib] [compat]
((<ruby-dev:23063>))

=== 2004-04-06
: Kernel#open [ruby] [change]
可能なら最初の引数に対して to_open を呼ぶようになりました。

: Exception#to_str [ruby] [obsolete]...

ruby 1.6 feature (36.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...from -:2
ruby 1.6.7 (2002-07-30) [i586-linux]

: 2002-06-03 sprintf()

"%d" で引数を整数にするときに、((<組み込み関数/Integer>)) と同じ規則を
使用するようになりました。

p sprintf("%d", nil)

=> -:1:in `sprintf': no implicit conversio...
...ので ALT_SEPARATOR は nil
true

: Integer[nth]

大きな値のインデックスに対して例外が発生していました。
((<ruby-bugs-ja:PR#114>))

p(-1[10000000000])

=> -:1:in `[]': bignum too big to convert into `int' (RangeError)
from -:...
...def initialize(obj) @obj = obj end
def []=() @obj = obj end
def []() @obj end
end
module Kernel
def _ptr() Ptr.new(self) end
end

def foo(int)
int[] += 1
end
x = 1._ptr...

絞り込み条件を変える

ruby 1.8.2 feature (18.0)

ruby 1.8.2 feature ruby 1.8.2 での ruby 1.8.1 からの変更点です。

...$ ruby-1.8.1 -e 'p [nil].pack("L")'
"\000\000\000\000"

$ ruby-1.8.2 -e 'p [nil].pack("L")'
-e:1:in `pack': cannot convert nil into Integer (TypeError)
from -e:1

$ ruby-1.8.2 -e 'p [nil].pack("P")'
"\000\000\000\000"

=== 2004-10-27
: CGI [lib] [bug]
...
...追加。((<ruby-dev:23912>))

: File::Stat#dev_major [ruby] [new]
: File::Stat#dev_minor [ruby] [new]
((<ruby-core:03195>))

=== 2004-07-05

: Kernel#URI [lib] [new]

uri で追加。((<ruby-dev:23784>))

=== 2004-07-01
: OpenSSL::Cipher::Cipher#pkcs5_keyivgen [lib] [new]
: OpenSSL::Ciphe...