syschk2.gms : Test impact of sys10 setting

Description

Check impact of sys10 settings to avoid errors when we know that we can use
ipower instead of rpower.

sys10=1: Changes rpower to ipower when the exponenent is constant and within
         e-12 of an integer.

Contributor: Lutz Westermann, May 2014


Small Model of Type : GAMS


Category : GAMS Test library


Main file : syschk2.gms

$title 'Test impact of sys10 setting' (SYSCHK2,SEQ=658)

$onText
Check impact of sys10 settings to avoid errors when we know that we can use
ipower instead of rpower.

sys10=1: Changes rpower to ipower when the exponenent is constant and within
         e-12 of an integer.

Contributor: Lutz Westermann, May 2014
$offText

scalar x;

* By default [sys10=0] (-2)**2 should give an execution error
x = (-2)**2;
abort$[execerror = 0] 'By default (-2)**2 should give an execution error';
execerror = 0;


option sys10=1;

* With sys10=1 (-1)**2 should be translated to power(-1, 2) (=ipower), which is OK
x = (-2)**2;

* There is a tolrance of 1e-12 when checking the exponent
x = (-2)**(2+1e-13);