- using System;
- using System.Text;
-
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Math.Floor(1.2) = " + Math.Floor(1.2));
- Console.WriteLine("Math.Truncate(1.2) = " + Math.Truncate(1.2));
-
- // 値が負の場合の切捨ては、要件に合わせて使用する必要有り
- Console.WriteLine("Math.Floor(-1.2) = " + Math.Floor(-1.2));
- Console.WriteLine("Math.Truncate(-1.2) = " + Math.Truncate(-1.2));
-
- Console.ReadLine();
- }
- }
- }
|