activemq-cpp-3.8.2
Math.h
Go to the documentation of this file.
1 
18 #ifndef _DECAF_LANG_MATH_H_
19 #define _DECAF_LANG_MATH_H_
20 
21 #include <decaf/util/Config.h>
22 
23 // On some systems there is a min and max macro defined.
24 #undef min
25 #undef max
26 
27 namespace decaf{
28 namespace lang{
29 
35  class DECAF_API Math {
36  public:
37 
38  static const double E;
39  static const double PI;
40 
41  public:
42 
43  Math() {}
44  virtual ~Math() {}
45 
46  public:
47 
55  static int abs( int value ) {
56  return value < 0 ? -value : value;
57  }
58 
66  static long long abs( long long value ) {
67  return value < 0 ? -value : value;
68  }
69 
86  static float abs( float value );
87 
105  static double abs( double value );
106 
117  //static double acos( double value );
118 
131  //static double asin( double value );
132 
144  //static double atan( double value );
145 
188  //static double atan2( double x, double y );
189 
204  //static double cbrt( double value );
205 
214  //static double cos( double value );
215 
228  //static double cosh( double value );
229 
240  //static double sin( double value );
241 
256  //static double sinh( double value );
257 
268  //static double tan( double value );
269 
285  //static double tanh( double value );
286 
301  static double sqrt( double value );
302 
319  static double pow( double base, double exp );
320 
335  //static double rint( double value );
336 
346  static short min( short a, short b ) {
347  return ( a <= b ? a : b );
348  }
349 
359  static int min( int a, int b ) {
360  return ( a <= b ? a : b );
361  }
362 
372  static unsigned int min( unsigned int a, unsigned int b ) {
373  return ( a <= b ? a : b );
374  }
375 
385  static long long min( long long a, long long b ) {
386  return ( a <= b ? a : b );
387  }
388 
401  static float min( float a, float b );
402 
415  static double min( double a, double b );
416 
426  static short max( short a, short b ) {
427  return ( a >= b ? a : b );
428  }
429 
439  static int max( int a, int b ) {
440  return ( a >= b ? a : b );
441  }
442 
452  static long long max( long long a, long long b ) {
453  return ( a >= b ? a : b );
454  }
455 
468  static float max( float a, float b );
469 
481  static double max( double a, double b );
482 
495  //static double log( double value );
496 
510  //static double log10( double value );
511 
529  //static double log1p( double value );
530 
549  static double ceil( double value );
550 
566  static double floor( double value );
567 
585  static int round( float value );
586 
604  static long long round( double value );
605 
625  //static double IEEEremainder( double f1, double f2 );
626 
643  static double random();
644 
656  //static double exp( double value );
657 
672  //static double expm1( double value );
673 
686  //static double hypot( double x, double y );
687 
700  static float signum( float value );
701 
714  static double signum( double value );
715 
721  static double toRadians( double angdeg ) {
722  return angdeg / 180 * PI;
723  }
724 
730  static double toDegrees( double angrad ) {
731  return angrad * 180 / PI;
732  }
733 
750  //static float ulp( float value );
751 
768  //static double ulp( double value );
769 
770  };
771 
772 }}
773 
774 #endif /*_DECAF_LANG_MATH_H_*/
Math()
Definition: Math.h:43
static long long abs(long long value)
Returns the absolute value of an long long value.
Definition: Math.h:66
static int max(int a, int b)
Returns the larger of two int values.
Definition: Math.h:439
virtual ~Math()
Definition: Math.h:44
static const double E
Definition: Math.h:38
The class Math contains methods for performing basic numeric operations such as the elementary expone...
Definition: Math.h:35
static double toDegrees(double angrad)
Returns the measure in degrees of the supplied radian angle.
Definition: Math.h:730
static short max(short a, short b)
Returns the larger of two short values.
Definition: Math.h:426
static double toRadians(double angdeg)
Returns the measure in radians of the supplied degree angle.
Definition: Math.h:721
static short min(short a, short b)
Returns the double value that is closest in value to the argument and is equal to a mathematical inte...
Definition: Math.h:346
static const double PI
Definition: Math.h:39
#define DECAF_API
Definition: Config.h:29
static int min(int a, int b)
Returns the smaller of two int values.
Definition: Math.h:359
static unsigned int min(unsigned int a, unsigned int b)
Returns the smaller of two unsigned int values.
Definition: Math.h:372
static int abs(int value)
Returns the absolute value of an int value.
Definition: Math.h:55
static long long min(long long a, long long b)
Returns the smaller of two long long values.
Definition: Math.h:385
static long long max(long long a, long long b)
Returns the larger of two long long values.
Definition: Math.h:452
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: AprPool.h:25