mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 05:40:38 +01:00
[liba] add constant INFINITY
Change-Id: I801a23f5bb84bd86a4e93f6c24815737555ee8ce
This commit is contained in:
@@ -69,7 +69,7 @@ float ExponentialLaw::cumulativeDistributiveFunctionAtAbscissa(float x) const {
|
||||
|
||||
float ExponentialLaw::cumulativeDistributiveInverseForProbability(float * probability) {
|
||||
if (*probability >= 1.0f) {
|
||||
return FLT_MAX+1.0f;
|
||||
return INFINITY;
|
||||
}
|
||||
if (*probability <= 0.0f) {
|
||||
return 0.0f;
|
||||
|
||||
@@ -58,7 +58,7 @@ float Law::finiteIntegralBetweenAbscissas(float a, float b) const {
|
||||
|
||||
float Law::cumulativeDistributiveInverseForProbability(float * probability) {
|
||||
if (*probability >= 1.0f) {
|
||||
return FLT_MAX+1.0f;
|
||||
return INFINITY;
|
||||
}
|
||||
if (!isContinuous()) {
|
||||
if (*probability <= 0.0f) {
|
||||
|
||||
@@ -106,10 +106,10 @@ float NormalLaw::standardNormalCumulativeDistributiveFunctionAtAbscissa(float ab
|
||||
|
||||
float NormalLaw::standardNormalCumulativeDistributiveInverseForProbability(float probability) {
|
||||
if (probability >= 1.0f) {
|
||||
return FLT_MAX+1.0f;
|
||||
return INFINITY;
|
||||
}
|
||||
if (probability <= 0.0f) {
|
||||
return -FLT_MAX-1.0f;
|
||||
return -INFINITY;
|
||||
}
|
||||
if (probability < 0.5f) {
|
||||
return -standardNormalCumulativeDistributiveInverseForProbability(1-probability);
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
LIBA_BEGIN_DECLS
|
||||
|
||||
#define NAN (0.0f/0.0f)
|
||||
#define HUGE_VALF 1e50f
|
||||
#define INFINITY HUGE_VALF
|
||||
#define M_E 2.71828182845904523536028747135266250
|
||||
#define M_PI 3.14159265358979323846264338327950288
|
||||
|
||||
|
||||
Reference in New Issue
Block a user