澳门永利娱乐官方下载

JSP 2.0 Expression Language - Basic Arithmetic


This example illustrates basic Expression Language arithmetic. Addition (+), subtraction (-), multiplication (*), division (/ or div), and modulus (% or mod) are all supported. Error conditions, like division by zero, are handled gracefully.
EL Expression Result
${1} 1
${1 + 2} 3
${1.2 + 2.3} 3.5
${1.2E4 + 1.4} 12001.4
${-4 - 2} -6
${21 * 2} 42
${3/4} 0.75
${3 div 4} 0.75
${3/0} Infinity
${10%4} 2
${10 mod 4} 2
${(1==2) ? 3 : 4} 4
十博最佳体育平台和记怡情娱乐苹果下载和记怡情娱乐苹果下载