~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/functions/real.cc

  • Committer: Brian Aker
  • Date: 2008-11-03 03:49:00 UTC
  • mfrom: (520.4.50 devel)
  • Revision ID: brian@tangent.org-20081103034900-znhvcgtipr3tlel5
Merging in Monty's work

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/functions/real.h>
21
22
 
22
23
#include CSTDINT_H
23
24
#include <cassert>
 
25
#include CMATH_H
24
26
 
25
 
#include <drizzled/functions/real.h>
 
27
#if defined(CMATH_NAMESPACE)
 
28
using namespace CMATH_NAMESPACE;
 
29
#endif
26
30
 
27
31
String *Item_real_func::val_str(String *str)
28
32
{
45
49
  return decimal_value;
46
50
}
47
51
 
 
52
int64_t Item_real_func::val_int()
 
53
{
 
54
  assert(fixed == 1);
 
55
  return (int64_t) rint(val_real());
 
56
}
 
57
 
 
58
void Item_real_func::fix_length_and_dec()
 
59
{
 
60
  decimals= NOT_FIXED_DEC;
 
61
  max_length= float_length(decimals);
 
62
}
48
63