Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit e04df19

Browse files
committed
core.math: Update toPrec comment to reflect how rounding is done.
1 parent 16e9d1b commit e04df19

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/core/math.d

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,11 @@ unittest
167167
/*************************************
168168
* Round argument to a specific precision.
169169
*
170-
* D language types specify a minimum precision, not a maximum. The
171-
* `toPrec()` function forces rounding of the argument `f` to the
172-
* precision of the specified floating point type `T`.
170+
* D language types specify only a minimum precision, not a maximum. The
171+
* `toPrec()` function forces rounding of the argument `f` to the precision
172+
* of the specified floating point type `T`.
173+
* The rounding mode used is inevitably target-dependent, but will be done in
174+
* a way to maximize accuracy. In most cases, the default is round-to-nearest.
173175
*
174176
* Params:
175177
* T = precision type to round to

0 commit comments

Comments
 (0)