ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
Math Struct Reference

Description:


Compiler plug-in that provides mathematical functions.

All identifier and function names are defined case insensitive and can not be abbreviated with the exclamation of remainder (shortenable up to remain) and random (shortenable up to rand).

Constants:

Type Name Description
Float PI The ratio of a circle's circumference to its diameter.
Float E Euler's number.


Functions:

Return Type Name Signature Description
Float abs Integer Computes the absolute value of an integer number.
Float abs Float Computes the absolute value of a floating point number.
Float ceil Float Returns the nearest integer not less than the given value.
Float floor Float Returns the nearest integer not greater than the given value.
Float trunc Float Returns the nearest integer not greater in magnitude than the given value.
Float round Float Returns the nearest integer, rounding away from zero in halfway cases.
Integer rint Float Returns the nearest integer, rounding away from zero in halfway cases.
Float max Integer,Integer Returns the greater of two integer numbers.
Float max Float, Float Returns the greater of two floating point numbers.
Float min Integer,Integer Returns the smaller of two integer numbers.
Float min Float, Float Returns the smaller of two floating point numbers.
Float remainder Float,Float Computes the remainder of the floating point division of the first argument by the second argument.
Float random Float Returns a random number in the range [0.0 ... 1.0[. Note uses std::rand. No seeding is performed. Invoke std::srand prior to using this function for the first time, if numbers should change between different runs of the software.
Float sin Float Computes sine.
Float asin Float Computes cosine.
Float cos Float Computes tangent.
Float acos Float Computes arc sine.
Float tan Float Computes arc cosine.
Float atan Float Computes arc tangent.
Float sinh Float Computes hyperbolic sine.
Float asinh Float Computes hyperbolic cosine.
Float cosh Float Computes hyperbolic tangent.
Float acosh Float Computes inverse hyperbolic sine.
Float tanh Float Computes inverse hyperbolic cosine.
Float atanh Float Computes inverse hyperbolic tangent.
Float exp Float Computes e raised to the given power.
Float exp2 Float Computes 2.0 raised to the given power.
Float exp10 Float Computes 10.0 raised to the given power.
Float log Float Computes natural base (e) logarithm.
Float log10 Float Computes common base (10) logarithm.
Float log2 Float Computes base 2.0 logarithm.
Float pow Float, Float Raises a given number to the given power.
Float pow10 Float Raises 10 to the given power.
Float sqrt Float Computes square root of a given number.
Float cbrt Float Computes cubic root of a given number.

Definition at line 74 of file math.hpp.

#include <math.hpp>

Inheritance diagram for Math:
[legend]
Collaboration diagram for Math:
[legend]

Public Method Index:

ALIB_API Math (Compiler &compiler)
 
virtual ~Math () override
 
- Public Method Index: inherited from Calculus
 Calculus (const NString &name, Compiler &compiler)
 
virtual ~Calculus () override
 
ALIB_API void AddBinaryOpOptimizations (BinaryOpOptimizationsTableEntry *table, size_t length)
 
template<size_t TCapacity>
void AddBinaryOpOptimizations (BinaryOpOptimizationsTableEntry(&table)[TCapacity])
 
void AddOperator (const String &op, Type lhsType, Type rhsType, CallbackDecl callback, const char *dbgCallbackName, Type resultType, CTInvokable cti)
 
void AddOperatorAlias (const String &alias, Type lhsType, Type rhsType, const String &op)
 
void AddOperatorAliases (OperatorAliasTableEntry *table, size_t length)
 
template<size_t TCapacity>
void AddOperatorAliases (OperatorAliasTableEntry(&table)[TCapacity])
 
ALIB_API void AddOperators (OperatorTableEntry *table, size_t length)
 
template<size_t TCapacity>
void AddOperators (OperatorTableEntry(&table)[TCapacity])
 
virtual ALIB_API bool TryCompilation (CIAutoCast &autoCast) override
 
virtual ALIB_API bool TryCompilation (CIBinaryOp &ciBinaryOp) override
 
virtual ALIB_API bool TryCompilation (CIFunction &ciFunction) override
 
virtual ALIB_API bool TryCompilation (CIUnaryOp &ciUnaryOp) override
 
- Public Method Index: inherited from CompilerPlugin
 CompilerPlugin (const NString &name, Compiler &compiler)
 
virtual ~CompilerPlugin ()
 

Additional Inherited Members

- Public Type Index: inherited from Calculus
using BinaryOpOptimizationsTableEntry = const std::tuple<String, lang::Side, Type, const Box&, const Box&>
 
using CTInvokable = bool
 
using OperatorAliasTableEntry = const std::tuple<String, Type, Type, String>
 
using OperatorTableEntry
 
- Public Static Field Index: inherited from Calculus
static constexpr CTInvokable CTI = true
 
static constexpr CTInvokable ETI = false
 
- Public Field Index: inherited from Calculus
MonoAllocator allocator
 
std::vector< AutoCastEntryAutoCasts
 
HashMap< BinOpOptKey, Box, BinOpOptKey::Hash, BinOpOptKey::EqualToBinaryOperatorOptimizations
 
std::vector< ConstantIdentifierEntryConstantIdentifiers
 
std::vector< FunctionEntryFunctions
 
HashMap< OperatorKey, String, OperatorKey::Hash, OperatorKey::EqualToOperatorAliases
 
HashMap< OperatorKey, std::tuple< CallbackDecl, Box, CTInvokable ALIB_DBG(, const char *) >, OperatorKey::Hash, OperatorKey::EqualToOperators
 
- Public Field Index: inherited from CompilerPlugin
CompilerCmplr
 
const NString Name
 

Constructor(s) / Destructor Details::

◆ Math()

ALIB_API Math ( Compiler & compiler)

Constructor. Creates the hash maps.

Parameters
compilerThe compiler we will get attached to.

◆ ~Math()

virtual ~Math ( )
inlineoverridevirtual

Virtual destructor

Definition at line 85 of file math.hpp.


The documentation for this struct was generated from the following file: