# Single float compare

**URL:** <https://forums.unrealengine.com/t/single-float-compare/397795>\
**Category:** Community & Industry Discussion\
**Tags:** math, compare, float, unreal-engine, question\
**Created:** [July 23, 2017, 6:21pm UTC](https://forums.unrealengine.com/t/single-float-compare/397795 "2017-07-23T18:21:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![U.Dev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/u.dev/32/474384_2.png) [@U.Dev](https://forums.unrealengine.com/u/U.Dev)\
**Post date:** [July 23, 2017, 6:21pm UTC](https://forums.unrealengine.com/t/single-float-compare/397795/1 "2017-07-23T18:21:47Z")

</div>

I need simple difference between 1 float if it’s possible, maybe it’s easy to do, but my math isn’t that great to figurate this out, i need help please !

Expl. if float is (250) and if it gets random by numbber - or +, in this case let’s say (-50) that will be equal 200, but all i need is my BP to count how much randomed number is far away from 250. In This case will be (-50)

one more Expl. Deep inside what i exactly need

1. Main Float (340) Random - or + (+38)  
= **(Difference i need) (+38)**
2. Second tick : Main Float (378)  
Random - or + (+2) = **(Difference i  
need) = (+40)**
3. Third Tick : Main  
Float (380) Random - or + (-100) =  
**(Difference i need) = (-60)**

i think i explain you exactly what i need !

---

<div class="post-metadata">

**Author:** ![ppchavan001](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ppchavan001](https://forums.unrealengine.com/u/ppchavan001)\
**Post date:** [July 23, 2017, 6:30pm UTC](https://forums.unrealengine.com/t/single-float-compare/397795/2 "2017-07-23T18:30:05Z")

</div>

try using two float variables 1. the main float 2. the randomized one  
and then u will only need to do is 2-1…
