1

As shown in the following script, I want to raise all elements of x to the power of y.

x=[-3,-2,3,3,3,4]
y=[1/3.0,0.334,0.334,1/3,1/3.0,2]
pow(x,y)

I noticed that the result contains NULL values for negative numbers as the base:

enter image description here

Is it a specific behavior of DolphinDB?

JaneYe
  • 181
  • 4

1 Answers1

1

Yes, in DolphinDB, when a negative number is raised to an exponent, the result is NULL.

In contrast, Python generates a complex number as the result:

pow(-3, 1/3.0) 
// output:(0.7211247851537043+1.2490247664834064j)
jinwandalaohu
  • 226
  • 1
  • 7