projects
/
mono.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
2005-07-24 Atsushi Enomoto <atsushi@ximian.com>
[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
}