output/csv: Avoid accumulated timestamp error for odd samplerates
The conversion of sample rates to sample periods and the repeated
addition of truncated values (integer variables) resulted in the
accumulation of errors in the timestamp column for odd samplerate
values. How to reproduce:
$ sigrok-cli -d demo:analog_channels=0 \
-c samplerate=
6000000 --samples
1200001 \
-O csv:time=true | tail
Accept the additional cost to reduce the error. Always get the timestamp
in a new calculation based on the sample number and the sample rate.
This addresses bug #1027.
Signed-off-by: Earle F. Philhower, III <redacted>
[ gsi: rephrased commit message, how to reprodue ]