hi guys))
please -someone who use MS Visual C# Express Edition - tell me is there System.Math (with mathematic functions) library there?

Thanks in advance!)

Recommended Answers

All 4 Replies

Yes there is. It's a class, not a namespace, so you have to qualify the calls to the static methods with Math, e.g., Math.abs() or whatever.

commented: +++++++ +1

Thank you! )) but which namespace should I use ? only System one?

Yes, the Math class lives in the System namespace it is static so you don't have to instantiate it.
Just use it like this:

// square will be equal to aNumber * aNumber
double square = Math.Pow(aNumber, 2.0);
commented: +++++++++ +1

Thank you,ddanbe!
(I always have problems with namespaces - I don't understand - why we need namespaces if there are "references")

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.