# exp, xexp¶

Raise to a power

## exp¶

Raise e to a power

Syntax: exp x, exp[x]

Returns ex, where e is the base of natural logarithms.

q)exp 1
2.718282
q)exp 0.5
1.648721
q)exp -4.2 0 0.1 0n 0w
0.01499558 1 1.105171 0n 0w


exp is an atomic function.

### Domain and range¶

domain b g x h i j e f c s p m d z n u v t
range  f . f f f f f f f . f f f z f f f f


Range: fz

## xexp¶

Raise x to a power

Syntax: x xexp y, xexp[x;y]

Where x and y are numerics, returns xy.

q)2 xexp 8
256f
q)9 xexp 0.5
3f
q)1.5 xexp -4.2 0 0.1 0n 0w
0.1821448 1 1.04138 0n 0w


exp is an atomic function.

Note

The calculation is performed as exp y * log x. If y is integer, this is not identical to prd y#x.


q)\P 0
q)prd 3#2
8
q)2 xexp 3
7.9999999999999982
q)exp 3 * log 2
7.9999999999999982


### Domain and range¶

xexp| b g x h i j e f c s p m d z n u v t
----| -----------------------------------
b   | f . f f f f f f . . . . . . . . . .
g   | . . . . . . . . . . . . . . . . . .
x   | f . f f f f f f . . . . . . . . . .
h   | f . f f f f f f . . . . . . . . . .
i   | f . f f f f f f . . . . . . . . . .
j   | f . f f f f f f . . . . . . . . . .
e   | f . f f f f f f . . . . . . . . . .
f   | f . f f f f f f . . . . . . . . . .
c   | . . . . . . . . . . . . . . . . . .
s   | . . . . . . . . . . . . . . . . . .
p   | . . . . . . . . . . . . . . . . . .
m   | . . . . . . . . . . . . . . . . . .
d   | . . . . . . . . . . . . . . . . . .
z   | . . . . . . . . . . . . . . . . . .
n   | . . . . . . . . . . . . . . . . . .
u   | . . . . . . . . . . . . . . . . . .
v   | . . . . . . . . . . . . . . . . . .
t   | . . . . . . . . . . . . . . . . . .


Range: f