TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
 Specialized Dev Zones Research Center eBook Library .NET Java C++ Web Dev Architecture Database Security Open Source Enterprise Mobile Special Reports 10-Minute Solutions DevXtra Blogs Slideshow

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

 Home » Tip Bank » .NET » VB.NET » Math Processing
Language: VB7
Expertise: beginner
Jun 22, 2002

### WEBINAR:On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning

# Take advantage of the new math functions

The System.Math class exposes several static methods that let you perform many common operations. These functions replace the VB6 functions with same name, but there are a few new functions that have no direct VB6 counterpart:

Ceiling(x) returns the integer equal or higher than the argument
Floor(x) returns the integer equal or lower than the argument
IEEERemainder(x, y) returns the remainder of the x/y division; it's similar to the MOD operator, but it works correctly also with floating point numbers
Log10(x) returns the base 10 logarithm of the argument
Min(x,y) returns the lowest of the two arguments
Max(x,y) returns the hiighest of the two arguments
Atan2(x, y) returns the arc-tangent of x/y; it is similar to Atan, but it works correctly in all four quadrants
Sinh(x), Cosh(x), Tanh(x) return the hyperbolic sine, cosine, and tange of the argument

``````
Console.WriteLine(Math.Ceiling(2.5))   ' displays 3
Console.WriteLine(Math.Floor(-3.8))    ' displays -4
``````
Finally, the Math class also exposes the E (Neper number) and PI constants.
Francesco Balena

 Submit a Tip Browse ".NET" Tips Browse All Tips
Comment and Contribute

(Maximum characters: 1200). You have 1200 characters left.

Thanks for your registration, follow us on our social networks to keep up-to-date