前田稔(Maeda Minoru)の超初心者のプログラム入門
![]()
![]()
/**********************************/
/*★ Data Type 一覧 前田 稔 ★*/
/**********************************/
using System;
class Text
{
public static void Main()
{
string format = "{0, -8}:{1}~{2}";
string dot = "----------------";
Console.WriteLine(format, "sbyte",sbyte.MinValue, sbyte.MaxValue);
Console.WriteLine(format, "short", short.MinValue, short.MaxValue);
Console.WriteLine(format, "int", int.MinValue, int.MaxValue);
Console.WriteLine(format, "long", long.MinValue, long.MaxValue);
Console.WriteLine(dot);
Console.WriteLine(format, "byte", byte.MinValue, byte.MaxValue);
Console.WriteLine(format, "ushort", ushort.MinValue, ushort.MaxValue);
Console.WriteLine(format, "uint", uint.MinValue, uint.MaxValue);
Console.WriteLine(format, "ulong", ulong.MinValue, ulong.MaxValue);
Console.WriteLine(dot);
Console.WriteLine(format, "float", float.MinValue, float.MaxValue);
Console.WriteLine(format, "double", double.MinValue, double.MaxValue);
Console.WriteLine(dot);
Console.WriteLine(format, "decimal", decimal.MinValue, decimal.MaxValue);
Console.WriteLine(dot);
}
}
|
| Console.WriteLine(format, "int", int.MinValue, int.MaxValue); |
| string format = "{0, -8}:{1}~{2}"; |
![]()
c:\DATA\C#>DataType sbyte :-128~127 short :-32768~32767 int :-2147483648~2147483647 long :-9223372036854775808~9223372036854775807 ---------------- byte :0~255 ushort :0~65535 uint :0~4294967295 ulong :0~18446744073709551615 ---------------- float :-3.402823E+38~3.402823E+38 double :-1.79769313486232E+308~1.79769313486232E+308 ---------------- decimal :-79228162514264337593543950335~79228162514264337593543950335 ----------------
![]()