FreeMarker: Numeric Operations Test

A simple test follows:

${message}

Start with the increment operator:

<#assign a1 = 0>

a1 = ${a1}

<#assign a1 = a1 + 1>

a1 = ${a1}

<#assign a1 = a1 + 1>

a1 = ${a1}

Now the decrement operator:

<#assign a2 = 5>

a2 = ${a2}

<#assign a2 = a2 - 1>

a2 = ${a2}

<#assign a2 = a2 - 1>

a2 = ${a2}

<#assign a2 = a2 - 1>

a2 = ${a2}

<#assign a2 = a2 - 1>

a2 = ${a2}

<#assign a2 = a2 - 1>

a2 = ${a2}

<#assign a2 = a2 - 1>

a2 = ${a2}

<#assign a2 = a2 - 1>

Now the add operator:

<#assign op1 = 5> <#assign op2 = 3> <#assign op3 = op1 + op2>

op1 = ${op1}, op2 = ${op2}, op3 = ${op3}

<#assign op3 = op3 + op2>

op3 = ${op3}

And the subtract operator:

<#assign op3 = op1 - op2 >

op1 = ${op1}, op2 = ${op2}, op3 = ${op3}

<#assign op3 = op3 - op2 >

op3 = ${op3}

The comparison operators:

<#assign list1 = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]> <#foreach item in list1>

Item is: ${item}

<#if item lt 5>

Item is less than five.

<#if item <= 7>

Item is less than or equals to seven.

<#if item gt 2>

Item is greater than two.

<#if (item >= 10)>

Item is greater than or equal to ten.