Last login: Thu Mar 24 10:53:07 on ttys008 The default interactive shell is now zsh. To update your account to use zsh, please run `chsh -s /bin/zsh`. For more details, please visit https://support.apple.com/kb/HT208050. MAC:Thu Mar 24:11:20:~> jshell | Welcome to JShell -- Version 17.0.1 | For an introduction type: /help intro jshell> Math.E $1 ==> 2.718281828459045 jshell> Math.PI $2 ==> 3.141592653589793 jshell> Math.PI = 3; | Error: | cannot assign a value to final variable PI | Math.PI = 3; | ^-----^ jshell> double x = 15.0 x ==> 15.0 jshell> Math.log(x) $4 ==> 2.70805020110221 jshell> double y = 1.0 y ==> 1.0 jshell> Math.log(y) $6 ==> 0.0 jshell> Math.log10(x) $7 ==> 1.1760912590556813 jshell> Math.log10(y) $8 ==> 0.0 jshell> Math.max(x, y) $9 ==> 15.0 jshell> Math.min(x, y) $10 ==> 1.0 jshell> Math.max(3, 4) $11 ==> 4 jshell> Math.max(3, 4.0) $12 ==> 4.0 jshell> Math.min(3, 4.0) $13 ==> 3.0 jshell> Math.acos(-1) $14 ==> 3.141592653589793 jshell> Math.asin(0) $15 ==> 0.0 jshell> Math.toDegrees(Math.atan(0.5)) $16 ==> 26.56505117707799 jshell> Math.toDegrees(Math.atan(1)) $17 ==> 45.0 jshell> Math.toDegrees(Math.atan(1, 1)) | Error: | method atan in class java.lang.Math cannot be applied to given types; | required: double | found: int,int | reason: actual and formal argument lists differ in length | Math.toDegrees(Math.atan(1, 1)) | ^-------^ jshell> Math.toDegrees(Math.atan2(1, 1)) $18 ==> 45.0 jshell> int x = -4 x ==> -4 jshell> Math.abs(x) $20 ==> 4 jshell> double x = -4.5 x ==> -4.5 jshell> Math.abs(x) $22 ==> 4.5 jshell> double x = Math.PI/6 x ==> 0.5235987755982988 jshell> Math.toDegrees(x) $24 ==> 29.999999999999996 jshell> int x = 180 x ==> 180 jshell> Math.toRadians(x) $26 ==> 3.141592653589793 jshell> Math.cbrt(27); $27 ==> 3.0 jshell> Math.cbrt(27.0f); $28 ==> 3.0 jshell> Math.cbrt(27.0d); $29 ==> 3.0 jshell> Math.exp(2); $30 ==> 7.38905609893065 jshell> Math.log(Math.exp(2)) $31 ==> 2.0 jshell> Math.floor(2.9) $32 ==> 2.0 jshell> Math.floor(2.9f) $33 ==> 2.0 jshell> Math.floor(-2.9f) $34 ==> -3.0 jshell> Math.floor(-219f) $35 ==> -219.0 jshell> Math.floor(-2.1f) $36 ==> -3.0 jshell> Math.ceil(2.1) $37 ==> 3.0 jshell> Math.hypot(3,4) $38 ==> 5.0 jshell> /exit | Goodbye MAC:Thu Mar 24:11:46:~>