using System;
public static class Program
{
public static void Main()
{
double dbl = 126.50;
sbyte sb = System.Convert.ToSByte(dbl);
Console.WriteLine(sb);
dbl = 126.51;
sb = System.Convert.ToSByte(dbl);
Console.WriteLine(sb);
dbl = 127.51;
sb = System.Convert.ToSByte(dbl); // OverflowException: Value was either too large...
}
}
/*
run:
126
127
*/