2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2026-04-04 04:18:22 +00:00
This commit is contained in:
2023-04-20 15:55:20 +03:00
parent 0ceaee88aa
commit a95b68c610
46 changed files with 2361 additions and 14 deletions

View File

@@ -12,6 +12,7 @@ namespace Esiur.Analysis.Statistics
public static implicit operator Probability(double v) => new Probability(v);
public static implicit operator double(Probability v) => v.Value;
public Probability(double value)
{
if (value > 1 || value < 0)
@@ -27,5 +28,15 @@ namespace Esiur.Analysis.Statistics
{
return (Math.Round(Value * 10000) / 100) + "%";
}
public Probability Power(double exponent)
{
return Math.Pow(Value, exponent);
}
public Probability Inverse()
{
return 1 - Value;
}
}
}