~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: tdavies
  • Date: 2010-10-05 03:25:08 UTC
  • mto: (1816.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1817.
  • Revision ID: tdavies@molly-20101005032508-pd1cg5nmxziov9wv
change in file: ../drizzled/base.h. Converted C structs key_range and KEY_MULTI_RANGE to C++ classes

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include <algorithm>
27
27
 
28
28
#include "drizzled/function/math/round.h"
29
 
#include "drizzled/util/test.h"
30
29
 
31
30
namespace drizzled
32
31
{
203
202
 
204
203
  if (truncate)
205
204
    value= (unsigned_flag) ?
206
 
      (int64_t)(((uint64_t) value / tmp) * tmp) : (value / tmp) * tmp;
 
205
      ((uint64_t) value / tmp) * tmp : (value / tmp) * tmp;
207
206
  else
208
207
    value= (unsigned_flag || value >= 0) ?
209
 
      (int64_t)(my_unsigned_round((uint64_t) value, tmp)) :
 
208
      my_unsigned_round((uint64_t) value, tmp) :
210
209
      -(int64_t) my_unsigned_round((uint64_t) -value, tmp);
211
210
  return value;
212
211
}