On Tue, 16 Jun 2020 20:53:34 +0200 Mattias Andrée <maand...@kth.se> wrote:
Dear Mattias, > I'm assuming temp.value i an `int`, as %d is used. The problem was > probably that `1E6` is actually a `double` rather than an `int`, > as the whole expression is promoted to `double`, because `bprintf` is > (I assume) variadic, and the compiler does not know to change the > cast the expression back to `int` because only the type of the first > argument is specified in its declaration. ah yes, of course! Thanks for pointing that out. It's never a good idea to work with floats when you end up casting to int in a step inbetween or after. Let's go with the FreeBSD-approach seen below that code. With best regards Laslo