~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2010-06-02 22:35:45 UTC
  • mto: This revision was merged to the branch mainline in revision 1586.
  • Revision ID: mordred@inaugust.com-20100602223545-q8ekf9b40a85nwuf
Rearragned unittests into a single exe because of how we need to link it
(thanks lifeless)
Link with server symbols without needing to build a library.
Added an additional atomics test which tests whatever version of the atomics
lib the running platform would actually use.

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
}