mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-20 19:48:05 +00:00
style patterns
This commit is contained in:
@@ -48,7 +48,10 @@ public sealed class LogCosh : BiInputIndicatorBase
|
||||
double absX = Math.Abs(x);
|
||||
// For large values, use asymptotic approximation to avoid overflow
|
||||
if (absX > 20.0)
|
||||
{
|
||||
return absX - 0.6931471805599453; // log(2)
|
||||
}
|
||||
|
||||
return Math.Log(Math.Cosh(x));
|
||||
}
|
||||
|
||||
@@ -67,7 +70,10 @@ public sealed class LogCosh : BiInputIndicatorBase
|
||||
ValidateBatchInputs(actual, predicted, output, period);
|
||||
|
||||
int len = actual.Length;
|
||||
if (len == 0) return;
|
||||
if (len == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const int StackAllocThreshold = 256;
|
||||
if (len <= StackAllocThreshold)
|
||||
@@ -91,4 +97,4 @@ public sealed class LogCosh : BiInputIndicatorBase
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user