# Difference in floating-point results for sqrt vs exponentiation on nightly (possible regression?)

**URL:** https://discourse.julialang.org/t/difference-in-floating-point-results-for-sqrt-vs-exponentiation-on-nightly-possible-regression/70207
**Category:** General Usage
**Tags:** question, math, float
**Created:** [October 22, 2021, 12:02pm UTC](https://discourse.julialang.org/t/difference-in-floating-point-results-for-sqrt-vs-exponentiation-on-nightly-possible-regression/70207 "2021-10-22T12:02:01Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jishnub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jishnub/32/33620_2.png) [@jishnub](https://discourse.julialang.org/u/jishnub)
#### Post date: [October 22, 2021, 12:02pm UTC](https://discourse.julialang.org/t/difference-in-floating-point-results-for-sqrt-vs-exponentiation-on-nightly-possible-regression/70207/1 "2021-10-22T12:02:01Z")

</div>

This used to work on previous versions of Julia, but fails on nightly

Julia 1.6 and 1.7rc1

```julia
julia> sqrt(1.5) == 1.5^0.5
true

```

nightly

```julia
julia> sqrt(1.5) == 1.5^0.5
false

```

I realize that floating-point results are not guaranteed to stay unchanged across versions, however are such results also expected to hold only approximately? Or would this be considered a regression?

---

<div class="post-metadata">

### Author: ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)
#### Post date: [October 22, 2021, 12:09pm UTC](https://discourse.julialang.org/t/difference-in-floating-point-results-for-sqrt-vs-exponentiation-on-nightly-possible-regression/70207/2 "2021-10-22T12:09:44Z")

</div>

This is a result of my rewrite of pow. In the new behavior, we are off by `0.512` ULPs which is well within tolerance of what we are allowed. That said, it might be worth special casing raising the the `.5` power. People use that a lot (even if they really shouldn’t)
