# Symbolics.jl: bug in unique() involving negative Floats?

**URL:** <https://discourse.julialang.org/t/symbolics-jl-bug-in-unique-involving-negative-floats/74925>\
**Category:** General Usage\
**Tags:** bug, symbolics\
**Created:** [January 20, 2022, 10:29am UTC](https://discourse.julialang.org/t/symbolics-jl-bug-in-unique-involving-negative-floats/74925 "2022-01-20T10:29:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhbdiehl](https://avatars.discourse-cdn.com/v4/letter/j/8491ac/32.png) [@jhbdiehl](https://discourse.julialang.org/u/jhbdiehl)\
**Post date:** [January 20, 2022, 10:29am UTC](https://discourse.julialang.org/t/symbolics-jl-bug-in-unique-involving-negative-floats/74925/1 "2022-01-20T10:29:12Z")

</div>

Hello there!

I encountered the weirdest behavior of the `unique()` function when throwing symbols at it:

```julia
using Symbolics

@variables a b

unique([-(a+1), -1.0(a+1)]) # 1-element Vector{Num}: -1 - a
unique([-a-b, -1(a+b)]) # 1-element Vector{Num}: -a - b
unique([2a+2b, 2.0(a+b)]) # 1-element Vector{Num}: 2a + 2b
unique([-(a+b), -1.0(a+b)]) # 2-element Vector{Num}: -a - b -a - b
isequal(-(a+b), -1.0(a+b)) # true

```

`unique()` seems to work as expected for linear manipulations involving `Int` and positive `Float`, but not negative `Float`.

According to the `unique()` documentation it is supposed to behave like `isequal()`, but this is clearly not the case here. I tried to look under the hood of `unique()` to figure out the problem, but I don’t understand anything, still too much of a noob it seems…

Please let me know whether or not this is a bug and if I can do anything to open a bug report or so (never done that).

Cheers,  
Johannes

P.S.: Using Julia 1.7 and Symbolics 4.3

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [January 20, 2022, 1:42pm UTC](https://discourse.julialang.org/t/symbolics-jl-bug-in-unique-involving-negative-floats/74925/2 "2022-01-20T13:42:47Z")

</div>

For bug reports please open an issue on the repo.
