Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / gtest-132.cs
1 //-- ex-nullable-sqrt
2
3 using System;
4
5 class MyTest {
6   public static int? Sqrt(int? x) {
7     if (x.HasValue && x.Value >= 0)
8       return (int)(Math.Sqrt(x.Value));
9     else
10       return null;
11   }
12
13   public static void Main(String[] args) {
14     // Prints :2:::
15     Console.WriteLine(":{0}:{1}:{2}:", Sqrt(5), Sqrt(null), Sqrt(-5));
16   }
17 }