~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

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