when trying to compare two floats, for testing, i ran into the usual 
problems with rounding.

so, i thought, a nice way out would be to compare their fixed precision 
formatted strings.

which works except, fmt "%f" fixed precision still contains an unnecessary 
rounding issue;

when the float is very near zero, (it can be slightly above or below 
depending on rounding), fmt adds a '-' or it doesn't, meaning you get for 
example "-0.00000"

why have just one value, zero, at which two floats, which are the same to 
the precision, print differently?
 
this doesn't seem to be 'human readable' output, no human would add the 
unnecessary '-'.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to