


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Classes, Methods, Example, Provide Abstract and Reuse, Header, Body, The return Statement, Calling a Method, MessageBox Buttons, Icons, Motivation, Objects, Creating and Accessing Objects
Typology: Slides
1 / 4
This page cannot be seen from the preview
Don't miss anything!



Method Description Example Abs( x ) absolute value of x Abs( 23.7 ) is 23. Abs( 0 ) is 0 Abs( -23.7 ) is 23. Ceiling( x ) rounds x to the smallest integer not less than x
Ceiling( 9.2 ) is 10. Ceiling( -9.8 ) is -9. Cos( x ) trigonometric cosine of x ( x in radians)
Cos( 0.0 ) is 1.
Exp( x ) exponential method ex Exp( 1.0 ) is approximately
Exp( 2.0 ) is approximately
Floor( x ) (^) rounds x to the largest integer not greater than x
Floor( 9.2 ) is 9. Floor( -9.8 ) is -10. Log( x ) natural logarithm of x (base e ) Log( 2.7182818284590451 ) is approximately 1. Log( 7.3890560989306504 ) is approximately 2. Max( x, y ) larger value of x and y (also has versions for float, int and long values)
Max( 2.3, 12.7 ) is 12. Max( -2.3, -12.7 ) is -2.
Min( x, y ) smaller value of x and y (also has versions for float, int and long values)
Min( 2.3, 12.7 ) is 2. Min( -2.3, -12.7 ) is -12. Pow( x, y ) (^) x raised to power y (xy) Pow( 2.0, 7.0 ) is 128. Pow( 9.0, .5 ) is 3. Sin( x ) trigonometric sine of x ( x in radians)
Sin( 0.0 ) is 0.
Sqrt( x ) (^) square root of x Sqrt( 900.0 ) is 30. Sqrt( 9.0 ) is 3. Tan( x ) trigonometric tangent of x ( x in radians)
Tan( 0.0 ) is 0.
Commonly used Math class methods.