# @code\_typed: positiveReal^realExponent

**URL:** https://discourse.julialang.org/t/code-typed-positivereal-realexponent/84727
**Category:** New to Julia
**Created:** [July 24, 2022, 10:40pm UTC](https://discourse.julialang.org/t/code-typed-positivereal-realexponent/84727 "2022-07-24T22:40:13Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mongi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mongi/32/43334_2.png) [@mongi](https://discourse.julialang.org/u/mongi)
#### Post date: [July 24, 2022, 10:40pm UTC](https://discourse.julialang.org/t/code-typed-positivereal-realexponent/84727/1 "2022-07-24T22:40:13Z")

</div>

Hi, using @code\_typed in the code below, shows that julia checks for the sign of a number X when raised to the power of a real number (pow function). is it possible to avoid this if X is positive X=abs(…)?  
code:  
`cTime+(abs(q[i]/df))^(1/3)`  
@code\_typed:

```julia
%25 = Base.abs_float(%24)::Float64
│ %26 = $(Expr(:foreigncall, "llvm.pow.f64", Float64, svec(Float64, Float64), 0, :(:llvmcall), :(%25), 0.3333333333333333, 0.3333333333333333, :(%25)))::Float64
│ %27 = Base.ne_float(%26, %26)::Bool
│ %28 = Base.add_float(%25, 0.3333333333333333)::Float64
│ %29 = Base.ne_float(%28, %28)::Bool
│ %30 = Base.not_int(%29)::Bool
│ %31 = Base.and_int(%27, %30)::Bool
└─── goto #7 if not %31
6 ── invoke Base.Math.throw_exp_domainerror(%25::Float64)::Union{}
└─── unreachable

```

thanks

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [July 25, 2022, 12:57am UTC](https://discourse.julialang.org/t/code-typed-positivereal-realexponent/84727/2 "2022-07-25T00:57:33Z")

</div>

> [@mongi](#):
>
> Hi, using @code\_typed in the code below, shows that julia checks for the sign of a number X when raised to the power of a real number (pow function). is it possible to avoid this if X is positive X=abs(…)?  
> code:  
> `cTime+(abs(q[i]/df))^(1/3)`

In general, the compiler can’t specialize on the value of the function, only the type…

However, in the particular case of `x^(1/3)` you should call the `cbrt` function rather than using generic exponentiation.
