~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/functions/sqrt.cc

  • Committer: Monty Taylor
  • Date: 2008-11-16 06:29:53 UTC
  • mto: (584.1.9 devel)
  • mto: This revision was merged to the branch mainline in revision 589.
  • Revision ID: monty@inaugust.com-20081116062953-ivdltjmfe009b5fr
Moved stuff into item/

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>
22
 
#include "sqrt.h"
 
20
#include <drizzled/server_includes.h>
 
21
#include CSTDINT_H
 
22
#include <drizzled/functions/sqrt.h>
 
23
#include CMATH_H
23
24
 
24
 
namespace drizzled
25
 
{
 
25
#if defined(CMATH_NAMESPACE)
 
26
using namespace CMATH_NAMESPACE;
 
27
#endif
26
28
 
27
29
double Item_func_sqrt::val_real()
28
30
{
29
31
  assert(fixed == 1);
30
32
  double value= args[0]->val_real();
31
33
  if ((null_value=(args[0]->null_value || value < 0)))
32
 
    return 0.0;
 
34
    return 0.0; /* purecov: inspected */
33
35
  return sqrt(value);
34
36
}
35
37
 
36
 
} /* namespace drizzled */