|
FAUST compiler
0.9.9.6b8
|
#include <stdio.h>#include <string.h>#include "doc_Text.hh"#include "compatibility.hh"#include <string>#include <vector>#include <iostream>#include <sstream>#include <assert.h>#include <cmath>#include <stdlib.h>#include "floats.hh"
Go to the source code of this file.
Macros | |
| #define | M_PI 3.14159265358979323846 |
| #define | M_PI_2 1.57079632679489661923 |
| #define | M_PI_4 0.785398163397448309616 |
| #define | M_E 2.71828182845904523536 |
Functions | |
| const string | symbolicNumber (double n) |
| Return symbolic or numerical representation of n. More... | |
| string | docT (char *c) |
| string | docT (int n) |
| string | docT (long n) |
| string | docT (double n) |
| float | fltEpsilon () |
| Compute the smallest float representable difference epsilon such that 1 != 1+epsilon. More... | |
| double | dblEpsilon () |
| Compute the smallest double representable difference epsilon such that 1 != 1+epsilon. More... | |
| static bool | AlmostEqual (double A, double B) |
| Check if two floating point numbers are (almost) equal Abs(x-y) < epsilon. More... | |
| bool | isPiPower (double n, string &s) |
| Return true if n>0 is equal to PI^k for some small integer k. More... | |
| bool | isExpPower (double n, string &s) |
| Return true if n>0 is equal to e^k for some small integer k. More... | |
| bool | isSymbolicPower (double n, string &s) |
| Return true if n>0 is equal to e^k or PI^k for some integer k The symbolic latex representation is returned in string s. More... | |
| const string | addFraction (int num, int denom, const string &exp) |
| Return exp or num.exp, or exp/denom, or num/denom.exp. More... | |
| const string | positiveSymbolicNumber (double n) |
| Return symbolic or numerical representation of n>0. More... | |
Variables | |
| bool | gInternDoubleSwitch |
| #define M_E 2.71828182845904523536 |
Definition at line 51 of file doc_Text.cpp.
| #define M_PI 3.14159265358979323846 |
Definition at line 39 of file doc_Text.cpp.
Referenced by isPiPower().
| #define M_PI_2 1.57079632679489661923 |
Definition at line 43 of file doc_Text.cpp.
| #define M_PI_4 0.785398163397448309616 |
Definition at line 47 of file doc_Text.cpp.
| const string addFraction | ( | int | num, |
| int | denom, | ||
| const string & | exp | ||
| ) |
Return exp or num.exp, or exp/denom, or num/denom.exp.
Definition at line 199 of file doc_Text.cpp.
Referenced by positiveSymbolicNumber().

|
static |
Check if two floating point numbers are (almost) equal Abs(x-y) < epsilon.
Definition at line 119 of file doc_Text.cpp.
References dblEpsilon().
Referenced by isExpPower(), and isPiPower().


| double dblEpsilon | ( | ) |
Compute the smallest double representable difference epsilon such that 1 != 1+epsilon.
Definition at line 105 of file doc_Text.cpp.
Referenced by AlmostEqual().

| string docT | ( | char * | c | ) |
Definition at line 77 of file doc_Text.cpp.
Referenced by DocCompiler::compileLateq(), DocCompiler::generateCode(), DocCompiler::generateIota(), DocCompiler::getFreshID(), and DocCompiler::prepareIntervallicUI().

| string docT | ( | int | n | ) |
Definition at line 78 of file doc_Text.cpp.
| string docT | ( | long | n | ) |
Definition at line 79 of file doc_Text.cpp.
| string docT | ( | double | n | ) |
Definition at line 80 of file doc_Text.cpp.
References symbolicNumber().

| float fltEpsilon | ( | ) |
Compute the smallest float representable difference epsilon such that 1 != 1+epsilon.
Definition at line 91 of file doc_Text.cpp.
| bool isExpPower | ( | double | n, |
| string & | s | ||
| ) |
Return true if n>0 is equal to e^k for some small integer k.
The latex representation e^{k} is returned in string s
Definition at line 163 of file doc_Text.cpp.
References abs(), and AlmostEqual().
Referenced by isSymbolicPower().


| bool isPiPower | ( | double | n, |
| string & | s | ||
| ) |
Return true if n>0 is equal to PI^k for some small integer k.
k = log(n)/log(pi) is integer => n = exp(int(k)*log(pi)) The latex representation ^{k} is returned in string s
Definition at line 143 of file doc_Text.cpp.
References abs(), AlmostEqual(), and M_PI.
Referenced by isSymbolicPower().


| bool isSymbolicPower | ( | double | n, |
| string & | s | ||
| ) |
Return true if n>0 is equal to e^k or PI^k for some integer k The symbolic latex representation is returned in string s.
Definition at line 183 of file doc_Text.cpp.
References isExpPower(), and isPiPower().
Referenced by positiveSymbolicNumber().


| const string positiveSymbolicNumber | ( | double | n | ) |
Return symbolic or numerical representation of n>0.
Definition at line 219 of file doc_Text.cpp.
References addFraction(), and isSymbolicPower().
Referenced by symbolicNumber().


| const string symbolicNumber | ( | double | n | ) |
Return symbolic or numerical representation of n.
Definition at line 260 of file doc_Text.cpp.
References positiveSymbolicNumber().
Referenced by docT().


| bool gInternDoubleSwitch |
1.8.7