Replacement for snprintf

berni44 dlang at d-ecke.de
Thu Oct 31 21:22:50 UTC 2019


On Wednesday, 30 October 2019 at 20:29:34 UTC, Rumbu wrote:
> In this case rounding becomes a question of how do you 
> interpret the remainder of a division by a power of ten.

Unfortunately not. Think of 0.1500000000000001 rounded to one 
digit. It's clear, that a reminder of 0-4 is rounded down and of 
6-9 is rounded up. But to decide in the case of a 5 you might 
need to look at the next digits if rounding mode tells you to 
round down in the case of 0.5...



More information about the Digitalmars-d mailing list