Skip to content

Commit 57657c6

Browse files
authored
Clarify what "schoolbook" rounding means (#77903)
1 parent 95f34eb commit 57657c6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

stdlib/public/core/FloatingPoint.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -938,8 +938,8 @@ public protocol FloatingPoint: SignedNumeric, Strideable, Hashable
938938
///
939939
/// For more information about the available rounding rules, see the
940940
/// `FloatingPointRoundingRule` enumeration. To round a value using the
941-
/// default "schoolbook rounding", you can use the shorter `rounded()`
942-
/// method instead.
941+
/// default "schoolbook rounding" of `.toNearestOrAwayFromZero`, you can use
942+
/// the shorter `rounded()` method instead.
943943
///
944944
/// print(x.rounded())
945945
/// // Prints "7.0"
@@ -974,8 +974,8 @@ public protocol FloatingPoint: SignedNumeric, Strideable, Hashable
974974
///
975975
/// For more information about the available rounding rules, see the
976976
/// `FloatingPointRoundingRule` enumeration. To round a value using the
977-
/// default "schoolbook rounding", you can use the shorter `round()` method
978-
/// instead.
977+
/// default "schoolbook rounding" of `.toNearestOrAwayFromZero`, you can use
978+
/// the shorter `round()` method instead.
979979
///
980980
/// var w1 = 6.5
981981
/// w1.round()

0 commit comments

Comments
 (0)