0

For example I am trying to calculate 9704−36 in C#. How should i go about doing this? I am using Visual C# 2010 Express

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
Nook
  • 179
  • 1
  • 3
  • 9

2 Answers2

5

Use Math.Pow(9704, -36). C# does not have a dedicated exponentiation operator and Math.Pow fills the gap.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
1

Exactly the same way you do it for a positive exponent:

Math.Pow(9704,-36)

There is no power operator in C# (^ is exclusive or, not power), so you need to use the Math.Pow function.

CodesInChaos
  • 106,488
  • 23
  • 218
  • 262