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