Skip to content

Commit 7679f56

Browse files
IvenBachmairaw
authored andcommitted
Update shape.cs (dotnet#2862)
* Update shape.cs Math.Pow(Math.PI * Radius, 2) should be Math.Pi * Radius * Radius since Area = pi * Radius^2 = pi * Radius * Radius * Update shape.cs Math.Pi => Math.PI * Update shape.cs * Update shape.cs * Update shape.cs
1 parent 75642ff commit 7679f56

File tree

1 file changed

+3
-3
lines changed
  • samples/snippets/csharp/tutorials/inheritance

1 file changed

+3
-3
lines changed

samples/snippets/csharp/tutorials/inheritance/shape.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public Circle(double radius)
6464
Radius = radius;
6565
}
6666

67-
public override double Area => Math.Round(Math.Pow(Math.PI * Radius, 2), 2);
67+
public override double Area => Math.Round(Math.PI * Math.Pow(Radius, 2), 2);
6868

6969
public override double Perimeter => Math.Round(Math.PI * 2 * Radius, 2);
7070

@@ -112,6 +112,6 @@ public static void Main()
112112
// Is Square: False, Diagonal: 15.62
113113
// Square: area, 25; perimeter, 20
114114
// Diagonal: 7.07
115-
// Circle: area, 88.83; perimeter, 18.85
115+
// Circle: area, 28.27; perimeter, 18.85
116116
// </Snippet3>
117-
} // Namespace definition.
117+
} // Namespace definition.

0 commit comments

Comments
 (0)