Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
は任意xの整数です。約 の値がありますx.1..x.4。に丸めたいのですがx.5、それが より上にある場合はまたはx.5と言って、 に丸める必要があります。そんなことがあるものか?Rubyに機能はありますか?x.7x.8(x+1).0
x
x.1..x.4
x.5
x.7
x.8
(x+1).0
(v*2).ceil.to_f / 2v は変数です。
(v*2).ceil.to_f / 2