~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/float.cc

Reverted 1103

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include "config.h"
21
 
 
22
 
#include <math.h>
23
 
 
 
20
#include <drizzled/server_includes.h>
24
21
#include <drizzled/error.h>
25
 
#include <drizzled/field.h>
26
 
#include <drizzled/item/float.h>
27
22
#include <drizzled/item/num.h>
28
23
#include <drizzled/item/string.h>
29
 
 
30
 
namespace drizzled
31
 
{
32
 
 
33
 
extern const CHARSET_INFO *system_charset_info;
 
24
#include <drizzled/item/float.h>
34
25
 
35
26
static uint32_t nr_of_decimals(const char *str, const char *end)
36
27
{
77
68
  return (int64_t) rint(value);
78
69
}
79
70
 
80
 
type::Decimal *Item_float::val_decimal(type::Decimal *decimal_value)
 
71
my_decimal *Item_float::val_decimal(my_decimal *decimal_value)
81
72
{
82
73
  // following assert is redundant, because fixed=1 assigned in constructor
83
74
  assert(fixed == 1);
84
 
  double2_class_decimal(E_DEC_FATAL_ERROR, value, decimal_value);
 
75
  double2my_decimal(E_DEC_FATAL_ERROR, value, decimal_value);
85
76
  return (decimal_value);
86
77
}
87
78
 
169
160
  return conv;
170
161
}
171
162
 
172
 
} /* namespace drizzled */
 
163