Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System.Math namespace not recognised

Status
Not open for further replies.

russellobrien

Programmer
May 14, 2003
28
0
0
GB
I was trying to use the Pow() and Abs() functions but cannot and also I cannot type "using System.Math" without the compiler saying this is not a valid namespace. Do I have ti import this namespace - it seems unusual for such a basic one or do I have a problem with installation?

Many thanks,

Russell

using VC#.NET standard
 
Right-click on the References section of your project workspace and add a reference to the System.Math assembly.

It should work after that.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
System.Math is a class, not a namespace, and declares its methods as static, thus the following should be what you need to do:

using System;

....

int x = Math.Abs(1.2);
 
pneutam is correct. Math is a class with static methods. No need to reference it. I should have checked first!!

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top