65件ヒット
[1-65件を表示]
(0.016秒)
種類
- 文書 (17)
- クラス (12)
- ライブラリ (12)
- 特異メソッド (12)
- インスタンスメソッド (12)
ライブラリ
- ビルトイン (36)
クラス
- File (24)
キーワード
-
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (8) - Numeric (12)
- bigdecimal (12)
検索結果
先頭5件
-
File
# truncate(length) -> 0 (18113.0) -
ファイルのサイズを最大 length バイトにします。
...書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX サイズの変更に失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "1234567890")
File.open("testfile", "a") do |f|
f.truncate(5) # => 0
f.size # => 5
end
//}... -
File
. truncate(path , length) -> 0 (18113.0) -
path で指定されたファイルのサイズを最大 length バイト にします。
...す文字列を指定します。
@param length 変更したいサイズを整数で与えます。
@raise Errno::EXXX 失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "1234567890")
File.truncate("testfile", 5) # => 0
File.size("testfile") # => 5
//}... -
Numeric (30.0)
-
数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。
...- o o -
singleton_method_added | o - - - - - -
size | - - o o - - -
Numeric Integer Fixnum Bi......- o o o
to_s | - - o o o o o
truncate | o o - - o o -
Numeric Integer Fixnum Bi......Numeric#ceil, Numeric#floor, Numeric#round, Numeric#truncate
のふるまいの違いの表です。左の実数に対して各メソッドを呼ぶと表のような数を
返します。
| ceil floor round truncate
------------------------------------------......round | o o o o -
singleton_method_added | o - - - -
size | - o - - -
step | o - - - -......to_r | - o o o o
to_s | - o o o o
truncate | o o o o -
upto | - o - - -... -
NEWS for Ruby 2
. 5 . 0 (24.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......ithub.com/ruby/psych/pull/312
* rbconfig
* RbConfig::LIMITS is added to provide the limits of C types.
This is available when rbconfig/sizeof is loaded.
* ripper
* Ripper::EXPR_BEG and so on for Ripper#state.
* Ripper#state を追加。スキャナーの状態を伝えるた... -
NEWS for Ruby 2
. 4 . 0 (18.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......-16BE/LE, UTF-32BE/LE, ISO-8859-1~16 をサポートしています。
Variations are available with options. 10085
* String.new(capacity: size) 12024
* StringIO
* StringIO#gets, StringIO#readline, StringIO#each_line, StringIO#readlines
省略可能なキーワード引数 cho... -
bigdecimal (12.0)
-
bigdecimal は浮動小数点数演算ライブラリです。 任意の精度で 10 進表現された浮動小数点数を扱えます。
...を指定できます。
//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......exponent >= exp )
t = t.div(m57121,sig)
u = t.div(k,sig)
pi = pi + u
k = k + two
end
pi
end
if $0 == __FILE__
if ARGV.size == 1
puts "PI("+ARGV[0]+"):"
puts big_pi(ARGV[0].to_i)
else
puts "TRY: ruby pi.rb 1000"
end
end
//}
=== その他
以下のメソ...