sec fixes
This commit is contained in:
@@ -16,8 +16,15 @@ namespace Lab
|
||||
get { return first + second; }
|
||||
set
|
||||
{
|
||||
first = Math.Truncate(value);
|
||||
second = Math.Abs(value - first);
|
||||
if (double.IsNaN(value) || double.IsInfinity(value))
|
||||
{
|
||||
first = 0;
|
||||
second = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
first = Math.Floor(value);
|
||||
second = value - first;
|
||||
|
||||
second = Math.Round(second, 10);
|
||||
|
||||
@@ -31,7 +38,14 @@ namespace Lab
|
||||
|
||||
public void Multiply(double m)
|
||||
{
|
||||
Value = Value * m;
|
||||
double res = Value * m;
|
||||
if (double.IsNaN(res) || double.IsInfinity(res))
|
||||
{
|
||||
first = 0;
|
||||
second = 0;
|
||||
return;
|
||||
}
|
||||
Value = res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user