Project

General

Profile

Actions

Bug #946

closed

Array#pack の f が入力として文字列を許容する

Added by tadf (tadayoshi funaba) over 15 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
Backport:

Description

=begin
main@191-20081229> ['1'].pack('f')
#=> "\x00\x00\x80?"

main@191-20081229> ['1'].pack('i')
TypeError: can't convert String into Integer

i ではエラーになるし、f で許す必要はないと思います。
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0