blob: f407f9976a8a70a0611e51e1b7afcdb3db67261b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
namespace DefaultNamespace
{
//@BEGINRENAME; Verify this renames
//@ENDRENAME; Verify this renames
using System;
class unsignedNegative
{
public static int Main(String[] args)
{
Int16 testUI = (-1);
Console.WriteLine(testUI);
Console.WriteLine((-1).ToString("d"));
testUI = Int16.Parse("32535");
Console.WriteLine(testUI);
if (testUI < 0) Console.WriteLine("Fail (testUI < 0)");
if (testUI < (Int16)0) Console.WriteLine("Fail (testUI < (ushort)0)");
else Console.WriteLine("cast to unsigned short worked");
testUI = Int16.Parse((-1).ToString("d"));
Console.WriteLine(testUI);
return testUI + 101;
}
}
}
|