## x^y, where x<0 and y non-integer

Problems with syntax of GAMS
Loreno
User
Posts: 5
Joined: 1 year ago

### x^y, where x<0 and y non-integer

this seems silly, but i cant get it done:

i want to simply calculate

x^y, but neighter the **operator nor the power() function is working, because x<0 and y is non-integer.

example:

(-0.1)^(1/5)

how can i do this in gams?

Fred
Posts: 87
Joined: 2 years ago

### Re: x^y, where x<0 and y non-integer

Loreno,

What you try to do is mathematically not defined.

Fred

Loreno
User
Posts: 5
Joined: 1 year ago

### Re: x^y, where x<0 and y non-integer

oh, i guess its been to long, that i have been to math class:) the reason i thought that it works, is that google actually gave me a result.

solution: (yes mathematicly not the same, but what i logicly wanted to do anyways)

-(abs(x)**y)

Fred
Posts: 87
Joined: 2 years ago

### Re: x^y, where x<0 and y non-integer

Hi Loreno,

The signPower function may be what you are looking for: https://www.gams.com/latest/docs/UG_Par ... =signpower

I hope this helps!

Best,
Fred