about | help | code help+videos | done | prefs |
apcsaPrimitivesDoubleDiv
Given two double values, a and b, calculate a / b. Return an int indicating the nature of the result: Return 0 if the result is a normal, finite number. Return 1 if the result is Double.POSITIVE_INFINITY. Return -1 if the result is Double.NEGATIVE_INFINITY. Return 2 if the result is Double.NaN (Not a Number). Caution here: Double.NaN has some unusual behavior as a value because Double.NaN == (any double value) always evaluates to false. You could use String conversion, or the handy helper method Double.isNaN to check this one.apcsaPrimitivesDoubleDiv(5.0, 2.0) → 0 apcsaPrimitivesDoubleDiv(1.0, 0.0) → 1 apcsaPrimitivesDoubleDiv(-1.0, 0.0) → -1 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 130
Copyright Nick Parlante 2017 - privacy