~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/math/real.cc

  • Committer: Brian Aker
  • Date: 2009-01-24 09:43:35 UTC
  • Revision ID: brian@gir-3.local-20090124094335-6qdtvc35gl5fvivz
Adding in an example singe thread scheduler

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include "config.h"
21
 
#include <math.h>
 
20
#include <drizzled/server_includes.h>
22
21
#include <drizzled/function/math/real.h>
23
22
 
24
 
namespace drizzled
25
 
{
 
23
#include CSTDINT_H
 
24
#include <cassert>
 
25
#if defined(HAVE_IEEEFP_H)
 
26
# include <ieeefp.h>
 
27
#endif
 
28
#include CMATH_H
26
29
 
 
30
#if defined(CMATH_NAMESPACE)
 
31
using namespace CMATH_NAMESPACE;
 
32
#endif
27
33
 
28
34
String *Item_real_func::val_str(String *str)
29
35
{
30
36
  assert(fixed == 1);
31
37
  double nr= val_real();
32
38
  if (null_value)
33
 
    return 0;
 
39
    return 0; /* purecov: inspected */
34
40
  str->set_real(nr,decimals, &my_charset_bin);
35
41
  return str;
36
42
}
41
47
  assert(fixed);
42
48
  double nr= val_real();
43
49
  if (null_value)
44
 
    return 0;
 
50
    return 0; /* purecov: inspected */
45
51
  double2my_decimal(E_DEC_FATAL_ERROR, nr, decimal_value);
46
52
  return decimal_value;
47
53
}
58
64
  max_length= float_length(decimals);
59
65
}
60
66
 
61
 
} /* namespace drizzled */