id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

orion.a.smith@gmail.com apcsa-primitives > apcsaPrimitivesOverflow
prev  |  next  |  chance

Given two int inputs a and b, find the value of a ^ b (a raised to the power b). Return true if the value of a ^ b is outside the bounds of the int data type, and false otherwise.


HINTS: Math.pow is your friend, as is type conversion to double.

apcsaPrimitivesOverflow(1, 2) → false
apcsaPrimitivesOverflow(2, 100) → true
apcsaPrimitivesOverflow(-3, 5) → false

...Save, Compile, Run (ctrl-enter)

public boolean apcsaPrimitivesOverflow(int a, int b) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 130

Copyright Nick Parlante 2017 - privacy