~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/math/neg.h

  • Committer: lbieber
  • Date: 2010-10-06 16:34:16 UTC
  • mfrom: (1816.1.3 build)
  • Revision ID: lbieber@orisndriz08-20101006163416-ea0sl59qgpglk21y
Merge Monty - Change the requirement from either libinnodb to libhaildb. Also, tied it to version 2.2
Merge Andrew - fix bug 650935: remove --compress from all clients
Merge Andrew - fix bug 653471: Add -A to drizzle client
Merge Travis - 621861 = To change C structs to C++ classes in Drizzle

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
28
28
 
29
29
class Item_func_neg :public Item_func_num1
30
30
{
31
 
  bool _is_negative;
32
 
 
33
31
public:
34
 
  Item_func_neg(Item *a) :
35
 
    Item_func_num1(a),
36
 
    _is_negative(true)
37
 
  {}
38
 
 
 
32
  Item_func_neg(Item *a) :Item_func_num1(a) {}
39
33
  double real_op();
40
34
  int64_t int_op();
41
 
  type::Decimal *decimal_op(type::Decimal *);
 
35
  my_decimal *decimal_op(my_decimal *);
42
36
  const char *func_name() const { return "-"; }
43
37
  enum Functype functype() const   { return NEG_FUNC; }
44
38
  void fix_length_and_dec();
45
39
  void fix_num_length_and_dec();
46
40
  uint32_t decimal_precision() const { return args[0]->decimal_precision(); }
47
 
 
48
 
  bool negative() const
49
 
  {
50
 
    return _is_negative;
51
 
  }
52
41
};
53
42
 
54
43
} /* namespace drizzled */