1
0
Files
OAiP-Presnyakov_Ilya-Labora…/SplitNumber.cs
Debug_pro 43d7845cf1 finally
2026-02-12 01:01:44 +03:00

38 lines
790 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Lab
{
internal class SplitNumber
{
public double first { get; private set; }
public double second { get; private set; }
public double Value
{
get { return first + second; }
set
{
first = Math.Truncate(value);
second = Math.Abs(value - first);
second = Math.Round(second, 10);
if (second >= 1)
{
first += 1;
second = 0;
}
}
}
public void Multiply(double m)
{
Value = Value * m;
}
}
}