Is Signed Number Type - CSharp System.Reflection

CSharp examples for System.Reflection:Type

Description

Is Signed Number Type

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Runtime.Serialization;
using System.Runtime.CompilerServices;
using System.Reflection.Emit;
using System.Reflection;
using System.Linq;
using System.IO;/*from   w ww.  j  av a2  s  . c  o m*/
using System.Globalization;
using System.Collections.Generic;
using System;

public class Main{
        public static bool IsSigned(this Type t)
        {
            return
                t == typeof(sbyte) ||
                t == typeof(short) ||
                t == typeof(int) ||
                t == typeof(long);
        }
}

Related Tutorials