Zerodivide


Specifies what value GEMPACK will compute for ratios with zero denominator. The possible ZERODIVIDE qualifiers are ZERO_BY_ZERO or NONZERO_BY_ZERO. ZERO_BY_ZERO is the default -- it applies when the numerator in the division is zero (zero divided by zero) while NONZERO_BY_ZERO applies when the numerator in the division is a nonzero number. ZERODIVIDE works only in formulae, not equations.

Examples

Zerodivide default A1; ! A1 must be real parameter !

Zerodivide default 1.0; ! applies only to 0/0 !

Zerodivide (nonzero_by_zero) default 0.0;! only for X/0 where X<>0!

Zerodivide off; ! applies only to 0/0!

Zerodivide (nonzero_by_zero) off; ! applies only to X/0 where X<>0!

Following example shows how shares are set to a common value when their denominator is zero:

Coefficient (Parameter) NIND ;

Formula (Initial) NIND = Sum{i,IND,1.0}; ! no of industries !

Coefficient (Parameter) RECIP_NIND ;

Formula (Initial) RECIP_NIND = 1/NIND ;

Zerodivide default RECIP_NIND ;

Formula (all,i,IND) YShare(i) = Y(i)/SUM{j,IND,Y(j)} ;

Zerodivide off ;

 

Gutter indication of Zerodivide scope

The 'gutter' is the narrow grey column at the left of the TABmate window (where line numbers are usually shown).  By default, a light blue mark appears on the RHS of the gutter for lines within the scope of a Zerodivide (zero_by_zero) statement. Just to the left of that,  a light green mark is drawn for lines within the scope of a Zerodivide (nonzero_by_zero) statement. No marks will be shown unless TABmate finds an up-to-date INF file (which contains data about Zerodivide statements) --  so you may need to use the TABLO Check button for the marks to become visible.

If you insert or delete lines in the TAB file, the Zerodivide marks will no longer be up-to-date -- use the TABLO Check button to correct this.

The Options.. Code and other Options menu lets you switch this feature on and off.

 

back to TABLO language contents



URL of this topic: www.copsmodels.com/webhelp/tabmate/hc_zerodivide.htm

Link to full GEMPACK Manual

Link to GEMPACK homepage