ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
math.hpp
Go to the documentation of this file.
1/** ************************************************************************************************
2 * \file
3 * This header file is part of module \alib_expressions of the \aliblong.
4 *
5 * \emoji :copyright: 2013-2024 A-Worx GmbH, Germany.
6 * Published under \ref mainpage_license "Boost Software License".
7 **************************************************************************************************/
8#ifndef HPP_ALIB_EXPRESSIONS_PLUGINS_MATH
9#define HPP_ALIB_EXPRESSIONS_PLUGINS_MATH
10
11#ifndef HPP_ALIB_EXPRESSIONS_PLUGINS_CALCULUS
13#endif
14
15
16namespace alib { namespace expressions { namespace plugins {
17
18/** ************************************************************************************************
19 * %Compiler plug-in that provides mathematical functions.
20 *
21 * All identifier and function names are defined case insensitive and can \e not be abbreviated with
22 * the exclamation of
23 * \b remainder (shortenable up to \b remain) and
24 * \b random (shortenable up to \b rand).
25 *
26 * <b>Constants:</b><br>
27 *
28 * Type | Name | Description
29 * --------|-------|-------------
30 * Float |\b PI | The ratio of a circle's circumference to its diameter.
31 * Float |\b E | Euler's number.
32 *
33 * <br>
34 * <b>Functions:</b><br>
35 *
36 * Return Type| Name | Signature | Description |
37 * -----------|-----------|------------|-------------|
38 * Float | \b abs | Integer | Computes the absolute value of an integer number.
39 * Float | \b abs | Float | Computes the absolute value of a floating point number.
40 * Float | \b ceil | Float | Returns the nearest integer not less than the given value.
41 * Float | \b floor | Float | Returns the nearest integer not greater than the given value.
42 * Float | \b trunc | Float | Returns the nearest integer not greater in magnitude than the given value.
43 * Float | \b round | Float | Returns the nearest integer, rounding away from zero in halfway cases.
44 * Integer | \b rint | Float | Returns the nearest integer, rounding away from zero in halfway cases.
45 * Float | \b max | Integer,Integer | Returns the greater of two integer numbers.
46 * Float | \b max | Float, Float | Returns the greater of two floating point numbers.
47 * Float | \b min | Integer,Integer | Returns the smaller of two integer numbers.
48 * Float | \b min | Float, Float | Returns the smaller of two floating point numbers.
49 * Float | \b remainder | Float,Float | Computes the remainder of the floating point division of the first argument by the second argument.
50 * Float | \b random | Float | Returns a random number in the range [0.0 ... 1.0[. Note uses \c std::rand. No seeding is performed. Invoke \c std::srand prior to using this function for the first time, if numbers should change between different runs of the software.
51 * Float | \b sin | Float | Computes sine.
52 * Float | \b asin | Float | Computes cosine.
53 * Float | \b cos | Float | Computes tangent.
54 * Float | \b acos | Float | Computes arc sine.
55 * Float | \b tan | Float | Computes arc cosine.
56 * Float | \b atan | Float | Computes arc tangent.
57 * Float | \b sinh | Float | Computes hyperbolic sine.
58 * Float | \b asinh | Float | Computes hyperbolic cosine.
59 * Float | \b cosh | Float | Computes hyperbolic tangent.
60 * Float | \b acosh | Float | Computes inverse hyperbolic sine.
61 * Float | \b tanh | Float | Computes inverse hyperbolic cosine.
62 * Float | \b atanh | Float | Computes inverse hyperbolic tangent.
63 * Float | \b exp | Float | Computes \e e raised to the given power.
64 * Float | \b exp2 | Float | Computes \e 2.0 raised to the given power.
65 * Float | \b exp10 | Float | Computes \e 10.0 raised to the given power.
66 * Float | \b log | Float | Computes natural base (\e e) logarithm.
67 * Float | \b log10 | Float | Computes common base (\e 10) logarithm.
68 * Float | \b log2 | Float | Computes base \e 2.0 logarithm.
69 * Float | \b pow | Float, Float | Raises a given number to the given power.
70 * Float | \b pow10 | Float | Raises \e 10 to the given power.
71 * Float | \b sqrt | Float | Computes square root of a given number.
72 * Float | \b cbrt | Float | Computes cubic root of a given number.
73 **************************************************************************************************/
74struct Math : public plugins::Calculus
75{
76 /** ********************************************************************************************
77 * Constructor. Creates the hash maps.
78 * @param compiler The compiler we will get attached to.
79 **********************************************************************************************/
80 ALIB_API Math( Compiler& compiler );
81
82 /** ********************************************************************************************
83 * Virtual destructor
84 **********************************************************************************************/
85 virtual ~Math() override {}
86};
87
88
89}}} // namespace [alib::expressions::detail]
90
91
92
93#endif // HPP_ALIB_EXPRESSIONS_PLUGINS_MATH
#define ALIB_API
Definition alib.hpp:538
Definition alib.cpp:57
ALIB_API Math(Compiler &compiler)
virtual ~Math() override
Definition math.hpp:85