javascript math formula to java (android) -
i not math. how can javascript math formula translated java (for android)? or can explain me formula is?
from gather, doing fpc_guide times (square root of fpc_iso), divided 100, divided fpc_aperture = fpc_range (rounded 2, 10 decimal places)
but doesn't seem right me.
var inttmp = $("#fpc_guide").val() * math.sqrt($("#fpc_iso").val() / 100) / $("#fpc_aperture").val(); $("#fpc_range").val(roundnumber(inttmp,2)); function roundnumber(rnum, rlength) { // arguments: number round, number of decimal places homecoming math.round(rnum*math.pow(10,rlength))/math.pow(10,rlength);
roundnumber(n,2)
rounds n
2 decimal places. nil multiplied 2. note if seek double
, resulting number not exact. if round 2.11357 2.11 , maintain double
, might still display 2.10999999999... if you're not careful how handle it. in java, it's best utilize bigdecimal
represent numbers number of decimal places.
the formula fpc_guide times (square root of (fpc_iso divided 100)), divided fpc_aperture. is, iso number divided 100 before take square root. need pay attending exact location of parentheses.
in java, math.sqrt
, math.pow
used same way in javascript. you'll have figure out how values, though, since java doesn't back upwards jquery syntax.
java javascript android math
No comments:
Post a Comment