Chapter 4 slides Flashcards
express exponent?
Math.exp(double a)
express natural log?
Math.log(double a)
express 10 based log?
Math.log10(double a)
express power?
Math,pow(double a, double b)
express square root?
Math.sqrt(double a)
round up to nearest integer?
Math.ceil(double a)
round down to nearest integer?
Math.floor(double a)
round to nearest integer?
Math.rint(double a)
return the max of two parameters?
Math.max(a, b)
return the minimum of two parameters?
Math.min(a,b)
return the absolute value of a parameter?
Math.abs(a)
generate a random double value greater than or equal to one parameter and less than another parameter?
a + Math.random() * b
Unicode
16 bit encoding scheme which takes two bytes, preceded by /u, expressed in four hexadecimal numbers that run from \u0000 to \uFFFF, so unicode can represent 65535 + 1 characters
ASCII code - ‘0’ to ‘9’
code value in decimal = 48 to 57
Unicode value = \uu30 to /uu0039
ASCII code ‘A’ to ‘Z’
code value in decimal = 65 to 90
Unicode value = \u0041 to \u005A