種類
- 特異メソッド (44)
- 文書 (15)
- インスタンスメソッド (11)
- ライブラリ (11)
キーワード
-
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 5 . 0 (7) - bigdecimal (11)
- open (44)
検索結果
先頭5件
-
StringIO
# truncate(len) -> Integer (21125.0) -
自身のサイズが len になるように、自身を切り詰め、もしくは拡大します。 拡大した場合は、その部分を 0 で埋めます。 len を返します。
...でない時に発生します。
@raise Errno::EINVAL len がマイナスの時に発生します。
//emlist[例][ruby]{
require "stringio"
a = StringIO.new("hoge", 'r+')
a.truncate(2)
a.string #=> "ho"
a.truncate(5)
a.string #=> "ho\000\000\000"
//}... -
NEWS for Ruby 2
. 4 . 0 (132.0) -
NEWS for Ruby 2.4.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
.../pull/1186
* Enumerator::Lazy#uniq を追加 11090
* File
* File.empty? を追加 9969
* Float
* Float#ceil, Float#floor, Float#truncate は
Float#roundと同じように省略可能な桁を指定する引数を受け付けるようになりました。12245
* Float#roun......alues! を追加 12512
* Integer
* Fixnum と Bignum は Integer に統合されました 12005
* Integer#ceil, Integer#floor, Integer#truncate は
Integer#round と同じように省略可能な桁を指定する引数を受け付けるようになりました 12245
* Integer#d......Regexp/String: Unicodeのバージョンを8.0.0から9.0.0に更新しました 12513
* RubyVM::Env
* 削除しました
* String
* String#casecmp? を追加 12786
* String#concat, String#prepend 複数の引数を受け付けるようになりました 12333
* String#each_li... -
NEWS for Ruby 2
. 5 . 0 (120.0) -
NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...readable_real?, File.writable?, File.writable_real?,
File.executable?, File.executable_real?, File.mkfifo, File.readlink,
File.truncate, File#truncate, File.chmod, File.lchmod, File.chown,
File.lchown, File.unlink, File.utime, File.lstat はGVLを解放するようになりまし......ージはユーザーにとってわかりやすいでしょう。 13405
* Integer
* Integer#round, Integer#floor, Integer#ceil, Integer#truncate は常に Integer を返すようになりました
13420
* Integer#pow を追加 12508 11003
* Integer#allbits?, Integer#anybits?, I......onSequence#trace_points を追加
* String
* String#-@ はフリーズされていない文字列の重複を排除します。
互換性のため、既にフリーズされている文字列には何もしません。 13077
* -"literal" (String#-@) は同じオブジェクトを... -
bigdecimal (18.0)
-
bigdecimal は浮動小数点数演算ライブラリです。 任意の精度で 10 進表現された浮動小数点数を扱えます。
...に自動変換することはできません。
文字列を数値に自動変換したい場合は bigdecimal.c の
「/* #define ENABLE_NUMERIC_STRING */」のコメントを外してから、
再コンパイル、再インストールする必要があります。
文字列で数値を与える......[][ruby]{
require "bigdecimal"
require "bigdecimal/math"
a = BigMath.E(10)
p c = "0.123456789" * a # => "0.1234567890.123456789"
//}
これは、String#* の内部で、BigDecimal が暗黙的に Integer に変換された結果です。
===[a:internal_structure] 内部構造
BigDecimal内部で......を指定できます。
//emlist[][ruby]{
require "bigdecimal"
p BigDecimal("2").div(3, 12).to_s(10) # 2.0 / 3.0
# => 0.6666666666 67e0
//}
: truncate, round, ceil, floor
これらのメソッドは小数点からの相対位置を指定して桁数を決定します。
//emlist[][ruby]{
requ... -
CSV
. open(filename , mode = "rb" , options = Hash . new) -> CSV (12.0) -
このメソッドは IO オブジェクトをオープンして CSV でラップします。 これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。
...* IO#isatty
* File#path
* IO#pid
* IO#pos
* IO#pos=
* IO#reopen
* IO#seek
* IO#stat
* StringIO#string
* IO#sync
* IO#sync=
* IO#tell
* IO#to_i
* IO#to_io
* File#truncate
* IO#tty?
@param filename ファイル名を指定します。
@param mode IO.open に指定で... -
CSV
. open(filename , mode = "rb" , options = Hash . new) {|csv| . . . } -> nil (12.0) -
このメソッドは IO オブジェクトをオープンして CSV でラップします。 これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。
...* IO#isatty
* File#path
* IO#pid
* IO#pos
* IO#pos=
* IO#reopen
* IO#seek
* IO#stat
* StringIO#string
* IO#sync
* IO#sync=
* IO#tell
* IO#to_i
* IO#to_io
* File#truncate
* IO#tty?
@param filename ファイル名を指定します。
@param mode IO.open に指定で... -
CSV
. open(filename , options = Hash . new) -> CSV (12.0) -
このメソッドは IO オブジェクトをオープンして CSV でラップします。 これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。
...* IO#isatty
* File#path
* IO#pid
* IO#pos
* IO#pos=
* IO#reopen
* IO#seek
* IO#stat
* StringIO#string
* IO#sync
* IO#sync=
* IO#tell
* IO#to_i
* IO#to_io
* File#truncate
* IO#tty?
@param filename ファイル名を指定します。
@param mode IO.open に指定で... -
CSV
. open(filename , options = Hash . new) {|csv| . . . } -> nil (12.0) -
このメソッドは IO オブジェクトをオープンして CSV でラップします。 これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。
...* IO#isatty
* File#path
* IO#pid
* IO#pos
* IO#pos=
* IO#reopen
* IO#seek
* IO#stat
* StringIO#string
* IO#sync
* IO#sync=
* IO#tell
* IO#to_i
* IO#to_io
* File#truncate
* IO#tty?
@param filename ファイル名を指定します。
@param mode IO.open に指定で...