# Float UnderFlow Error

**URL:** <https://forums.unrealengine.com/t/float-underflow-error/1290058>\
**Category:** Programming & Scripting\
**Tags:** float, unreal-engine, bug-report, question, CPP\
**Created:** [September 10, 2023, 2:00pm UTC](https://forums.unrealengine.com/t/float-underflow-error/1290058 "2023-09-10T14:00:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZonKY420](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZonKY420](https://forums.unrealengine.com/u/ZonKY420)\
**Post date:** [September 10, 2023, 2:00pm UTC](https://forums.unrealengine.com/t/float-underflow-error/1290058/1 "2023-09-10T14:00:24Z")

</div>

so I’m not that experienced with c++ yet.  
I believe that the problem is that there’s a float underflow error.  
but I’m not really sure how to go about solving that.

would really appreciate some help on this

```c
// Adjust the starting position for the sphere sweep to match the bottom of the capsule.
FVector SweepStart = CapsuleLocation - (CharacterUpVector*(PawnHalfHeight - PawnRadius));

SweepStart {X=5.490716046094e-315#DEN Y=0.0000000000000000 Z=-515.55547790540504} UE::Math::TVector<double>

CapsuleLocation {X=-515.55644955580078 Y=3297.8822023619878 Z=97.441433419731169} const UE::Math::TVector<double> &

CharacterUpVector {X=0.00097976236391282383 Y=-0.72453746722546297 Z=0.68923471956382287} UE::Math::TVector<double>

PawnHalfHeight 55.0000000 float

PawnRadius 35.0000000 float

```

also when crouching so with a smaller pawnhalfheight the float underflow error goes away

---

<div class="post-metadata">

**Author:** ![ZonKY420](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZonKY420](https://forums.unrealengine.com/u/ZonKY420)\
**Post date:** [September 11, 2023, 10:01am UTC](https://forums.unrealengine.com/t/float-underflow-error/1290058/2 "2023-09-11T10:01:41Z")

</div>

yh so i simplyfied the problem more.

```auto
FVector tempvalue = FVector(0, 0, 55);
	
FVector SweepCapsuleCenter = FVector(CapsuleLocation.X - tempvalue.X, CapsuleLocation.Y - tempvalue.Y, CapsuleLocation.Z - tempvalue.Z);

```

so for some reason even if im only subtracting 55 from just the z axis it make the other axis also change/break

````auto
{X=1.260373362460e-311#DEN Y=6.951683486879e-310#DEN Z=2.337630270699e-311#DEN}```
which does not make any sense to me
````

---

<div class="post-metadata">

**Author:** ![ZonKY420](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZonKY420](https://forums.unrealengine.com/u/ZonKY420)\
**Post date:** [September 11, 2023, 10:53am UTC](https://forums.unrealengine.com/t/float-underflow-error/1290058/3 "2023-09-11T10:53:58Z")

</div>

so if you look at a value in breakpoints u need to make sure that the value actually has been calculated before taking the value as proof that its not your code thats bad but the program. because if i just waited for it to be calculated it would have been the correct value

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [October 11, 2023, 10:54am UTC](https://forums.unrealengine.com/t/float-underflow-error/1290058/4 "2023-10-11T10:54:00Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
