Skip to content

Commit 2d62b56

Browse files
Fix example output of BigInteger(Int64) (#11035)
* Fix example output of `BigInteger(Int64)` * Add missing project files * Resolve `Example` identifier conflict * Apply suggestions from code review --------- Co-authored-by: Bill Wagner <[email protected]>
1 parent 3b8675b commit 2d62b56

File tree

7 files changed

+23
-10
lines changed

7 files changed

+23
-10
lines changed

snippets/csharp/System.Numerics/BigInteger/.ctor/Example1.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using System.Numerics;
33

4-
public class Example
4+
public class Example1
55
{
66
public static void Main()
77
{

snippets/csharp/System.Numerics/BigInteger/.ctor/Example2.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using System.Numerics;
33

4-
public class Example
4+
public class Example2
55
{
66
public static void Main()
77
{
@@ -98,13 +98,13 @@ private static void LongConstructor()
9898
constructed.Equals(assigned));
9999
}
100100
// The example displays the following output:
101-
// -2147483648 = -2147483648: True
101+
// -9223372036854775808 = -9223372036854775808: True
102102
// -10534 = -10534: True
103103
// -189 = -189: True
104104
// 0 = 0: True
105105
// 17 = 17: True
106106
// 113439 = 113439: True
107-
// 2147483647 = 2147483647: True
107+
// 9223372036854775807 = 9223372036854775807: True
108108
// </Snippet7>
109109
}
110110

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<OutputType>Library</OutputType>
4+
<TargetFramework>net9.0</TargetFramework>
5+
</PropertyGroup>
6+
</Project>

snippets/fsharp/System.Numerics/BigInteger/.ctor/Example2.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ let longConstructor () =
6363
let assigned = number
6464
printfn $"{constructed} = {assigned}: {constructed.Equals assigned}"
6565
// The example displays the following output:
66-
// -2147483648 = -2147483648: True
66+
// -9223372036854775808 = -9223372036854775808: True
6767
// -10534 = -10534: True
6868
// -189 = -189: True
6969
// 0 = 0: True
7070
// 17 = 17: True
7171
// 113439 = 113439: True
72-
// 2147483647 = 2147483647: True
72+
// 9223372036854775807 = 9223372036854775807: True
7373
// </Snippet7>
7474

7575
let singleConstructor () =

snippets/visualbasic/VS_Snippets_CLR_System/system.Numerics.BigInteger.ctors/vb/Example1.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Option Strict On
33

44
Imports System.Numerics
55

6-
Module Example
6+
Module Example1
77
Public Sub Main()
88
Console.WindowWidth = 90
99
CreateSimpleArray()

snippets/visualbasic/VS_Snippets_CLR_System/system.Numerics.BigInteger.ctors/vb/Example2.vb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Option Strict On
33

44
Imports System.Numerics
55

6-
Module Example
6+
Module Example2
77
Public Sub Main()
88
DecimalConstructor()
99
Console.WriteLine("-----")
@@ -92,13 +92,13 @@ Module Example
9292
constructed.Equals(assigned))
9393
Next
9494
' The example displays the following output:
95-
' -2147483648 = -2147483648: True
95+
' -9223372036854775808 = -9223372036854775808: True
9696
' -10534 = -10534: True
9797
' -189 = -189: True
9898
' 0 = 0: True
9999
' 17 = 17: True
100100
' 113439 = 113439: True
101-
' 2147483647 = 2147483647: True
101+
' 9223372036854775807 = 9223372036854775807: True
102102
' </Snippet7>
103103
End Sub
104104

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<OutputType>Library</OutputType>
4+
<TargetFramework>net9.0</TargetFramework>
5+
6+
</PropertyGroup>
7+
</Project>

0 commit comments

Comments
 (0)