User Tools

Site Tools


gams:difference_between_the_-operator_and_the_power_function

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
gams:difference_between_the_-operator_and_the_power_function [2008/04/02 20:06]
support
gams:difference_between_the_-operator_and_the_power_function [2008/07/26 05:49] (current)
support
Line 1: Line 1:
 ====== What is the difference between the ** operator and the power function? ====== ====== What is the difference between the ** operator and the power function? ======
    
-The power function ''​power(x,​y)''​ is an integer power and thus the exponent ''​y''​ must be an integer.+The power function ''​power(x,​y)''​ is an integer power and thus the exponent ''​y''​ must be an integer. ​
  
-This is not required for the %%**%% operator. ​ %%x**y%% is a real power and gets evaluated as ''​exp(y * log(x))''​. +This is not required for the %%**%% operator. ​ %%x**y%% is a real power and gets evaluated as ''​exp(y * log(x))''​. ​The real power is not defined for a negative base (e.g. http://​www.cppreference.com/​stdmath/​pow.html) -  ​''​x''​ must be a positive number (or ''​y >= 0'',​ if  ''​x = 0''​) to avoid an execution error. So: 
-However in that case ''​x''​ must be a positive number (or ''​y >= 0'',​ if  ''​x = 0''​) to avoid an execution error. So: +
 <​code>​ <​code>​
 scalar test;  scalar test; 
IMPRESSUM / LEGAL NOTICEPRIVACY POLICY gams/difference_between_the_-operator_and_the_power_function.txt · Last modified: 2008/07/26 05:49 by support