github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/libraries/flosch/pongo2.v3/template_tests/expressions.tpl (about) 1 integers and complex expressions 2 {{ 10-100 }} 3 {{ -(10-100) }} 4 {{ -(-(10-100)) }} 5 {{ -1 * (-(-(10-100))) }} 6 {{ -1 * (-(-(10-100)) ^ 2) ^ 3 + 3 * (5 - 17) + 1 + 2 }} 7 8 floats 9 {{ 5.5 }} 10 {{ 5.172841 }} 11 {{ 5.5 - 1.5 == 4 }} 12 {{ 5.5 - 1.5 == 4.0 }} 13 14 mul/div 15 {{ 2 * 5 }} 16 {{ 2 * 5.0 }} 17 {{ 2 * 0 }} 18 {{ 2.5 * 5.3 }} 19 {{ 1/2 }} 20 {{ 1/2.0 }} 21 {{ 1/0.000001 }} 22 23 logic expressions 24 {{ !true }} 25 {{ !(true || false) }} 26 {{ true || false }} 27 {{ true or false }} 28 {{ false or false }} 29 {{ false || false }} 30 {{ true && (true && (true && (true && (1 == 1 || false)))) }} 31 32 float comparison 33 {{ 5.5 <= 5.5 }} 34 {{ 5.5 < 5.5 }} 35 {{ 5.5 > 5.5 }} 36 {{ 5.5 >= 5.5 }} 37 38 remainders 39 {{ (simple.number+7)%7 }} 40 {{ (simple.number+7)%7 == 0 }} 41 {{ (simple.number+7)%6 }} 42 43 in/not in 44 {{ 5 in simple.intmap }} 45 {{ 2 in simple.intmap }} 46 {{ 7 in simple.intmap }} 47 {{ !(5 in simple.intmap) }} 48 {{ not(7 in simple.intmap) }} 49 50 issue #48 (associativity for infix operators) 51 {{ 34/3*3 }} 52 {{ 10 + 24 / 6 / 2 }} 53 {{ 6 - 4 - 2 }}