> I was taught "Round [only] before printing.". These days it would be > something like "Round [only] before your API returns to the calling > program.
Those are not the same. Round only before printing (whether to the screen or to a printer). In other words, rounding is a way to make things palatable for humans. Therefore, the rounding function should only be used when the next step is presenting the value to a human. If the value is not being directly presented to a human, then you should not be rounding (yet). In other words, you do not apply the rounding when your API returns (for example, in the sin() function). You apply rounding only when the next consumer is a human. If there is the slightest possibility that the next consumer is not a human, you should not be rounding.