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