~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/str/format.cc

  • Committer: Monty Taylor
  • Date: 2009-03-08 23:45:12 UTC
  • mto: (923.2.1 mordred)
  • mto: This revision was merged to the branch mainline in revision 921.
  • Revision ID: mordred@inaugust.com-20090308234512-tqkygxtu1iaig23s
Removed C99 isnan() usage, which allows us to remove the util/math.{cc,h} workarounds. Yay for standards!

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 */
19
19
 
20
20
#include <drizzled/server_includes.h>
 
21
#include <drizzled/function/str/format.h>
 
22
 
21
23
#include CSTDINT_H
22
 
#include CMATH_H
23
 
#include <drizzled/function/str/format.h>
 
24
#include <limits>
24
25
 
25
 
#if defined(CMATH_NAMESPACE)
26
 
using namespace CMATH_NAMESPACE;
27
 
#endif
 
26
using namespace std;
28
27
 
29
28
/**
30
29
  Change a number to format '3,333,333,333.000'.
97
96
    nr= my_double_round(nr, (int64_t) dec, false, false);
98
97
    /* Here default_charset() is right as this is not an automatic conversion */
99
98
    str->set_real(nr, dec, default_charset());
100
 
    if (isnan(nr))
 
99
    if (nr == numeric_limits<double>::quiet_NaN())
101
100
      return str;
102
101
    str_length=str->length();
103
102
    if (nr < 0)