浏览代码

Merge pull request #8486 from JamesDeFabia/15311DocsDivideByZero

HPCC-15311 Fix docs for DivideByZero

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday 9 年之前
父节点
当前提交
222a93d21e

+ 18 - 13
docs/ECLLanguageReference/ECLR_mods/ExpressionsandOperatos.xml

@@ -80,14 +80,17 @@
       </tgroup>
       </tgroup>
     </informaltable>
     </informaltable>
 
 
-    <para>Division by zero<indexterm><primary>Division by zero</primary></indexterm>
-	defaults to generating a zero result (0), rather than reporting a “divide by zero” error.  
-	This avoids invalid or unexpected data aborting a long job.
-	The default behaviour can be changed using </para>
-	<programlisting>#option ('divideByZero', ...);</programlisting> 
-	<para>The #option can take the following values:
-	</para>
-     <informaltable colsep="1" frame="all" rowsep="1">
+    <para>Division by zero<indexterm>
+        <primary>Division by zero</primary>
+      </indexterm> defaults to generating a zero result (0), rather than
+    reporting a “divide by zero” error. This avoids invalid or unexpected data
+    aborting a long job. The default behaviour can be changed using</para>
+
+    <programlisting>#OPTION ('divideByZero', 'zero'); //evaluate to zero</programlisting>
+
+    <para>The divideByZero option can have the following values:</para>
+
+    <informaltable colsep="1" frame="all" rowsep="1">
       <tgroup align="left" cols="2">
       <tgroup align="left" cols="2">
         <colspec colwidth="194.80pt" />
         <colspec colwidth="194.80pt" />
 
 
@@ -99,23 +102,25 @@
 
 
             <entry>Evaluate to 0 - the default behaviour.</entry>
             <entry>Evaluate to 0 - the default behaviour.</entry>
           </row>
           </row>
+
           <row>
           <row>
             <entry>'fail'</entry>
             <entry>'fail'</entry>
 
 
             <entry>Stop and report a division by zero error.</entry>
             <entry>Stop and report a division by zero error.</entry>
           </row>
           </row>
+
           <row>
           <row>
             <entry>'nan'</entry>
             <entry>'nan'</entry>
 
 
-            <entry>This is only currently supported for real numbers.  Division by zero
-			creates a quiet NaN, which will propogate through any real expressions it is used in.
-			You can use NOT ISVALID(x) to test if the value is a NaN.
-			Integer and decimal division by zero continue to return 0.</entry>
+            <entry>This is only currently supported for real numbers. Division
+            by zero creates a quiet NaN, which will propagate through any real
+            expressions it is used in. You can use NOT ISVALID(x) to test if
+            the value is a NaN. Integer and decimal division by zero continue
+            to return 0.</entry>
           </row>
           </row>
         </tbody>
         </tbody>
       </tgroup>
       </tgroup>
     </informaltable>
     </informaltable>
-
   </sect2>
   </sect2>
 
 
   <sect2 id="Bitwise_Operators">
   <sect2 id="Bitwise_Operators">

+ 18 - 2
docs/ECLLanguageReference/ECLR_mods/Templ-OPTION.xml

@@ -477,10 +477,26 @@
 
 
               <entry>Number of records to limit to</entry>
               <entry>Number of records to limit to</entry>
             </row>
             </row>
+
+            <row>
+              <entry><emphasis>divideByZero</emphasis></entry>
+
+              <entry>Default zero</entry>
+
+              <entry>'zero' evaluates to 0, the default behavior. 'fail'
+              causes the job to fail and report a division by zero error.
+              'nan' (only currently supported for real numbers) creates a
+              quiet NaN, which will propagate through any real expressions it
+              is used in. You can use NOT ISVALID(x) to test if the value is a
+              NaN. Integer and decimal division by zero continue to return 0.
+              </entry>
+            </row>
           </tbody>
           </tbody>
         </tgroup>
         </tgroup>
       </informaltable></para>
       </informaltable></para>
 
 
+    <para></para>
+
     <para><emphasis role="bold">The following options are all about generating
     <para><emphasis role="bold">The following options are all about generating
     Logical graphs in a workunit. </emphasis></para>
     Logical graphs in a workunit. </emphasis></para>
 
 
@@ -953,8 +969,8 @@
 
 
               <entry>Default: 3 for roxie, else 0</entry>
               <entry>Default: 3 for roxie, else 0</entry>
 
 
-              <entry>Set the C++ compiler optimization level (optimizations can cause the compiler
-              to take a lot longer).</entry>
+              <entry>Set the C++ compiler optimization level (optimizations
+              can cause the compiler to take a lot longer).</entry>
             </row>
             </row>
 
 
             <row>
             <row>