get sign for number
Published: 14. October 2011 | Updated: 14. October 2011License: Microsoft Public License (MS-PL)
Categories: Framework » Math
Tags: C# Math
int sign = Math.Sign(16795); Console.WriteLine(sign); sign = Math.Sign(-4579); Console.WriteLine(sign); sign = Math.Sign(0); Console.WriteLine(sign);Console Output:
1
-1
0
-1
0
| Send us feedback about this snippet » |





