るりまサーチ

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

別のキーワード

  1. openssl integer
  2. asn1 integer
  3. _builtin integer
  4. integer chr
  5. integer upto

ライブラリ

クラス

モジュール

検索結果

<< 1 2 > >>

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

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

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

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

p Integer(nil) # c...
...nvert nil 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")...
...れる
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 String#hex,String#oct,String#to_...

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

引数を整数 に変換した結果を返します。

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

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

p Integer(nil) # c...
...nvert nil 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")...
...れる
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 String#hex,String#oct,String#to_...

String#oct -> Integer (18286.0)

文字列を 8 進文字列であると解釈して、整数に変換します。

...例][ruby]{
p "10".oct # => 8
p "010".oct # => 8
p "8".oct # => 0
//}

oct
は文字列の接頭辞 ("0", "0b", "0B", "0x", "0X") に応じて
8 進以外の変換も行います。

//emlist[例][ruby]{
p "0b10".oct # => 2
p "10".oct # => 8
p "010".oct # => 8
p "0x10".oct # => 16
//}

...
...][ruby]{
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 を使用しま...

CSV#ioctl(cmd, arg = 0) -> Integer (6201.0)

IO#ioctl に委譲します。

...IO#ioctl に委譲します。


@see IO#ioctl...

Fcntl::O_NOCTTY -> Integer (6201.0)

開いたファイルが端末デバイスでも、制御端末にはなりません。

開いたファイルが端末デバイスでも、制御端末にはなりません。

絞り込み条件を変える

File::Constants::NOCTTY -> Integer (6201.0)

自身がTTY制御しないようにTTYを開きます。 File.openで使用します。

自身がTTY制御しないようにTTYを開きます。
File.openで使用します。

IO#ioctl(cmd, arg = 0) -> Integer (6201.0)

IO に対してシステムコール ioctl を実行し、その結果を返します。 機能の詳細は ioctl(2) を参照してください。

...IO に対してシステムコール ioctl を実行し、その結果を返します。
機能の詳細は ioctl(2) を参照してください。

@param cmd IO に対するコマンドを整数で指定します。どのようなコマンドが使えるかはプラットフォームに依存し...
...ます。

@param arg cmd に対する引数を指定します。整数の時にはその値を ioctl に渡します。
文字列の場合には Array#pack した構造体だとみなして渡します。
arg が nil か false の場合には 0を、true の場合には 1 を...

OpenSSL::ASN1::OCTET_STRING -> Integer (6201.0)

ASN.1 UNIVERSAL タグの、 OCTET_STRING のタグ番号 4 を表す定数です。

...ASN.1 UNIVERSAL タグの、
OCT
ET_STRING のタグ番号 4 を表す定数です。...

ruby 1.8.4 feature (180.0)

ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。

...05-09-21) [i686-linux]
:
# => ruby 1.8.4 (2005-12-16) [i686-linux]
-:1: empty symbol literal

: Symbol [bug]

#Sat Oct 22 13:26:57 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
#
# * object.c (sym_inspect), parse.y (parser_yylex, rb_symname_p): check
#...
...ny arguments for format string
: super: no superclass method `foo' (NoMethodError)
from -:7

: 正規表現 [bug]

#Wed Oct 19 01:27:07 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
#
# * regex.c (re_compile_pattern): numeric literal inside character class
#...
...:35 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
#
# * sprintf.c (rb_str_format): integer overflow check added.
#
# * sprintf.c (GETASTER): ditto.

printfのフォーマット指定子にinteger overflowのバグがありました。
perl のそれとは違い、セキュリテ...

String#hex -> Integer (119.0)

文字列に 16 進数で数値が表現されていると解釈して整数に変換します。 接頭辞 "0x", "0X" とアンダースコアは無視されます。 文字列が [_0-9a-fA-F] 以外の文字を含むときはその文字以降を無視します。

...# => 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
などを使ってください。...

絞り込み条件を変える

<< 1 2 > >>