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!)
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!)
Jump to PostYes, 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);
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.
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);
Thank you,ddanbe!
(I always have problems with namespaces - I don't understand - why we need namespaces if there are "references")
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.