Discussion 解説
The following example shows the results of rounding numbers using this rule: 以下の例は、この規則を使っての数の丸めの結果を示します:
(5.2).rounded(.down)
// 5.0
(5.5).rounded(.down)
// 5.0
(-5.2).rounded(.down)
// -6.0
(-5.5).rounded(.down)
// -6.0
This rule is equivalent to the C floor
function and implements the round
operation defined by the IEEE 754 specification.
この規則は、C floor
関数の等価物です、そしてround
演算を実装し、それはIEEE 754仕様によって定義されます。