Study Math Class in AP Computer Science a with focused flashcards that help you recognize the idea, recall the key rule, and apply it in practice-style prompts.
AP Computer Science a
Math Class
0 mastered0 still learning
0% Complete
01
QUESTION
1/ 32
What is the return value of Math.addExact(2147483647, 1)?
Tap card or press Space to flip
01
ANSWER
Throws ArithmeticException. Integer overflow causes ArithmeticException to be thrown.
How well did you know it?
Got it!
Still Learning
Card 1 / 32
Space to flip · ← / → to move · once flipped, → Got it · ← Still learning
What this deck covers
This deck focuses on Math Class, giving you a quick way to review the definitions, rules, and examples that matter most for AP Computer Science a.
How to use these flashcards
Work through these flashcards in short sessions. Try to answer each prompt before flipping the card, then revisit any cards you miss until the explanation feels automatic.
All flashcards
Flashcard 1: What is the return value of Math.addExact(2147483647, 1)?
Answer: Throws ArithmeticException. Integer overflow causes ArithmeticException to be thrown.
Flashcard 2: What is the return value of Math.min(-2, -5)?
Answer: -5. Returns the smaller of the two values.
Flashcard 3: What is Math.E approximately equal to?
Answer: 2.718281828459045. The mathematical constant e (Euler's number).
Flashcard 4: What is the return value of Math.min(-2, -5)?
Answer: -5. Returns the smaller of the two values.
Flashcard 5: What is the result of Math.hypot(3, 4)?
Answer: 5.0. Calculates 32+42=25=5.
Flashcard 6: What does Math.subtractExact(-2147483648, 1) return?
Answer: Throws ArithmeticException. Integer underflow causes ArithmeticException to be thrown.
Flashcard 7: What is Math.PI approximately equal to?
Answer: 3.141592653589793. The mathematical constant π (pi).
Flashcard 8: What does Math.floor(3.7) return?
Answer: 3.0. Rounds down to the nearest integer value.
Flashcard 9: What does Math.floor(3.7) return?
Answer: 3.0. Rounds down to the nearest integer value.
Flashcard 10: What does Math.toRadians(180) return?
Answer: 1PI radians. Converts 180 degrees to radians using π radians per 180 degrees.
Flashcard 11: State the formula for calculating the hypotenuse using Math methods.
Answer: Math.sqrt(a2+b2). Uses the Pythagorean theorem for right triangle hypotenuse.
Flashcard 12: What is the result of Math.ceil(4.2)?
Answer: 5.0. Rounds up to the nearest integer value.
Flashcard 13: What does Math.abs(-5) return?
Answer:
Returns the absolute value, removing the negative sign.
Flashcard 14: What does Math.toRadians(180) return?
Answer: 1PI radians. Converts 180 degrees to radians using π radians per 180 degrees.
Flashcard 15: State the formula for calculating the hypotenuse using Math methods.
Answer: Math.sqrt(a2+b2). Uses the Pythagorean theorem for right triangle hypotenuse.
Flashcard 16: What is the return value of Math.addExact(2147483647, 1)?
Answer: Throws ArithmeticException. Integer overflow causes ArithmeticException to be thrown.
Flashcard 17: What is the result of Math.ceil(4.2)?
Answer: 5.0. Rounds up to the nearest integer value.
Flashcard 18: What is Math.PI approximately equal to?
Answer: 3.141592653589793. The mathematical constant π (pi).
Flashcard 19: What does Math.abs(-5) return?
Answer:
Returns the absolute value, removing the negative sign.
Flashcard 20: What is the result of Math.random() * 10?
Answer: A random double between 0.0 and 10.0. Multiplies random value by 10 to scale the range.
Flashcard 21: State the result of Math.max(3, 7).
Answer:
Returns the larger of the two values.
Flashcard 22: What does Math.sqrt(16) return?
Answer: 4.0. Returns the square root of 16, which is 4.
Flashcard 23: What does Math.subtractExact(-2147483648, 1) return?
Answer: Throws ArithmeticException. Integer underflow causes ArithmeticException to be thrown.
Flashcard 24: What is the result of Math.pow(2, 3)?
Answer:
Calculates 23=2×2×2.
Flashcard 25: What does Math.round(4.5) return?
Answer:
Rounds to the nearest integer using banker's rounding.
Flashcard 26: What does Math.round(4.5) return?
Answer:
Rounds to the nearest integer using banker's rounding.
Flashcard 27: What is the result of Math.random() * 10?
Answer: A random double between 0.0 and 10.0. Multiplies random value by 10 to scale the range.
Flashcard 28: What does Math.sqrt(16) return?
Answer: 4.0. Returns the square root of 16, which is 4.
Flashcard 29: What is Math.E approximately equal to?
Answer: 2.718281828459045. The mathematical constant e (Euler's number).
Flashcard 30: What is the result of Math.hypot(3, 4)?
Answer: 5.0. Calculates 32+42=25=5.
Flashcard 31: State the result of Math.max(3, 7).
Answer:
Returns the larger of the two values.
Flashcard 32: What is the result of Math.pow(2, 3)?