Skip to main content

Timeline for Rounding off to nearest number

Current License: CC BY-SA 4.0

5 events
when toggle format what by license comment
May 17, 2018 at 7:17 history edited mirthybrink CC BY-SA 4.0
deleted 104 characters in body
May 17, 2018 at 7:16 comment added mirthybrink yeah you are right, this hack works only for going up
May 17, 2018 at 7:01 comment added ilkkachu Also, you can't round down with printf("%d", x - 0.5). If x is say, 1.3, then x - 0.5 = 0.8, which is truncated to 0. And with + 0.5 you don't get rounding up, but the usual rounding to nearest with .5 going up.
May 17, 2018 at 6:51 comment added ilkkachu looking at the markdown source of the original question, I think they meant the input data was split on lines, five fields each
May 17, 2018 at 6:45 history answered mirthybrink CC BY-SA 4.0