resolved tickets #904 (nicer floating-point formatting) and #816 (reduce with CV_REDUCE_AVG on 8-bit arrays)

This commit is contained in:
Vadim Pisarevsky
2011-05-31 14:01:21 +00:00
parent 1299941622
commit 6de72ea8ee
2 changed files with 3 additions and 2 deletions

View File

@@ -775,7 +775,7 @@ icvDoubleToString( char* buf, double value )
sprintf( buf, "%d.", ivalue );
else
{
static const char* fmt = "%.16e";
static const char* fmt = "%.17g";
char* ptr = buf;
sprintf( buf, fmt, value );
if( *ptr == '+' || *ptr == '-' )
@@ -814,7 +814,7 @@ icvFloatToString( char* buf, float value )
sprintf( buf, "%d.", ivalue );
else
{
static const char* fmt = "%.8e";
static const char* fmt = "%.9g";
char* ptr = buf;
sprintf( buf, fmt, value );
if( *ptr == '+' || *ptr == '-' )