jcastura    01/01/11 15:35:09

  Modified:    xdocs    user-guide.xml
  Log:
  Adding division by zero to Velocity math.
  
  Revision  Changes    Path
  1.26      +25 -0     jakarta-velocity/xdocs/user-guide.xml
  
  Index: user-guide.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/xdocs/user-guide.xml,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- user-guide.xml    2001/01/11 03:22:39     1.25
  +++ user-guide.xml    2001/01/11 23:35:08     1.26
  @@ -1454,6 +1454,31 @@
       logged and a null will be returned as the output.
     </p>
   
  +  <p>
  +    Velocity has a built-in way of dealing with division by zero. In the following 
example
  +  </p>
  +
  +  <p>
  +    <source><![CDATA[
  +    #set( $foo = 5 )
  +    #set( $bar = $foo - 5 )
  +    #set( $uhoh = $foo / $bar )
  +    $uhoh
  +    ]]></source>
  +  </p>  
  +
  +  <p>
  +    The reference <variable>$uhoh</variable> is assigned the value of five divided 
by zero.
  +    When Velocity renders this template, the output will be:
  +  </p>
  +
  +  <p>
  +    <source><![CDATA[
  +    $uhoh
  +    ]]></source>
  +  </p>  
  +  
  +
     </s1>
   
     <s1 title="Range Operator">
  
  
  

Reply via email to