# How can this test be returning false negatives?

**URL:** <https://forums.unrealengine.com/t/how-can-this-test-be-returning-false-negatives/343905>\
**Category:** Blueprint\
**Tags:** compare, unreal-engine, UE4, Blueprint, question\
**Created:** [January 13, 2016, 2:19am UTC](https://forums.unrealengine.com/t/how-can-this-test-be-returning-false-negatives/343905 "2016-01-13T02:19:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Unisink2020](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Unisink2020](https://forums.unrealengine.com/u/Unisink2020)\
**Post date:** [January 13, 2016, 2:19am UTC](https://forums.unrealengine.com/t/how-can-this-test-be-returning-false-negatives/343905/1 "2016-01-13T02:19:54Z")

</div>

Pairs of compared vectors that are identical sometimes fail the test when they should be passing it. How can this be, and how do I fix this?

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/b/0/db0c32c5a144e4d06d30a7900c65254296786b47.jpeg) ](https://i.imgur.com/ES7rFsH.jpg)

---

<div class="post-metadata">

**Author:** ![FiftyStars](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FiftyStars](https://forums.unrealengine.com/u/FiftyStars)\
**Post date:** [January 13, 2016, 8:29am UTC](https://forums.unrealengine.com/t/how-can-this-test-be-returning-false-negatives/343905/2 "2016-01-13T08:29:06Z")

</div>

have you tried to add a breakpoint to your false branch?

---

<div class="post-metadata">

**Author:** ![Trcioo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Trcioo](https://forums.unrealengine.com/u/Trcioo)\
**Post date:** [January 13, 2016, 3:40pm UTC](https://forums.unrealengine.com/t/how-can-this-test-be-returning-false-negatives/343905/3 "2016-01-13T15:40:26Z")

</div>

Comparing float = float is unreliable, for instance, float1 can be 124.015455145 and float2 124.015455146.

You might want to use for this case a struct of Ints.  
Even something more reliable would be trigger boxes with Tags, so, entering on a trigger box you get its Tag and add to the visited blocks array and/or compare if the actor already has the Tag for that trigger box.

---

<div class="post-metadata">

**Author:** ![Nsomnia](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nsomnia](https://forums.unrealengine.com/u/Nsomnia)\
**Post date:** [January 13, 2016, 4:55pm UTC](https://forums.unrealengine.com/t/how-can-this-test-be-returning-false-negatives/343905/4 "2016-01-13T16:55:56Z")

</div>

Vectors are floating point and VERY VERY precise (to 6-15 digits) so even the engine ticking and physics calculations make them != to eachother.

Split the vector struct (right click on it) and compare each axis (x,y,z or roll, pitch, yaw) with a nearly equal (float) node and use a tolerance to your likings.

Regards,  
Nsomnia -UnrealTek
