~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mystrings/dtoa.cc

Reverted my change to interval_list

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
 ***************************************************************/
37
37
 
38
 
#include "config.h"
39
 
 
40
 
#include "drizzled/internal/m_string.h"  /* for memcpy and NOT_FIXED_DEC */
41
 
 
42
 
#include <float.h>
43
 
 
44
 
#include <cstdlib>
45
 
#include <cerrno>
 
38
#include <mystrings/m_string.h>  /* for memcpy and NOT_FIXED_DEC */
 
39
#include <stdlib.h>
 
40
 
46
41
#include <algorithm>
47
42
 
48
43
using namespace std;
49
44
 
50
 
namespace drizzled
51
 
{
52
 
namespace internal
53
 
{
54
 
 
55
45
/* Magic value returned by dtoa() to indicate overflow */
56
46
#define DTOA_OVERFLOW 9999
57
47
 
223
213
  if (x < 0.)
224
214
    width--;
225
215
 
226
 
  res= dtoa(x, 4, type == MY_GCVT_ARG_DOUBLE ? min(width, DBL_DIG) : 
227
 
            min(width, FLT_DIG), &decpt, &sign, &end);
 
216
  res= dtoa(x, 4, type == MY_GCVT_ARG_DOUBLE ? width : min(width, FLT_DIG),
 
217
            &decpt, &sign, &end);
228
218
 
229
219
  if (decpt == DTOA_OVERFLOW)
230
220
  {
2473
2463
    *rve= s;
2474
2464
  return s0;
2475
2465
}
2476
 
 
2477
 
} /* namespace internal */
2478
 
} /* namespace drizzled */