# Blueprint Math Expression: How do I get the sign of a value?

**URL:** <https://forums.unrealengine.com/t/blueprint-math-expression-how-do-i-get-the-sign-of-a-value/428217>\
**Category:** Blueprint\
**Tags:** math-expression, unreal-engine, question\
**Created:** [June 27, 2018, 3:37pm UTC](https://forums.unrealengine.com/t/blueprint-math-expression-how-do-i-get-the-sign-of-a-value/428217 "2018-06-27T15:37:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_4b24d331](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4b24d331](https://forums.unrealengine.com/u/anonymous_user_4b24d331)\
**Post date:** [June 27, 2018, 3:37pm UTC](https://forums.unrealengine.com/t/blueprint-math-expression-how-do-i-get-the-sign-of-a-value/428217/1 "2018-06-27T15:37:10Z")

</div>

I’m wondering how the sign node is called in math expressions nodes. I know that there are alternatives (like a/abs(a) in case a != 0), but I’d really prefer to use the sign(a) command instead.  
I’ve tried both, sign(a), and SignOfFloat(a), but none of those works.

So, how do I get the sign of a float within a math expression node?

---

<div class="post-metadata">

**Author:** ![Felix\_Leonhart](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Felix\_Leonhart](https://forums.unrealengine.com/u/Felix_Leonhart)\
**Post date:** [June 27, 2018, 4:06pm UTC](https://forums.unrealengine.com/t/blueprint-math-expression-how-do-i-get-the-sign-of-a-value/428217/2 "2018-06-27T16:06:26Z")

</div>

Here:

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/6/0/b601c98f763c523da6c5cba11ae5547357516b63.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4b24d331](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4b24d331](https://forums.unrealengine.com/u/anonymous_user_4b24d331)\
**Post date:** [June 28, 2018, 7:37am UTC](https://forums.unrealengine.com/t/blueprint-math-expression-how-do-i-get-the-sign-of-a-value/428217/3 "2018-06-28T07:37:15Z")

</div>

I am well aware that there’s a sign (float) blueprint node and there are conditional nodes. However that was not my question. I was asking if, and if yes, how one can get the sign of a value within a _math expression_, ideally by syntax that expands to only a single node. Maybe I should rephrase the question a bit: How is the Sign (float) node called in math expressions?

---

<div class="post-metadata">

**Author:** ![HarryHighDef](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HarryHighDef](https://forums.unrealengine.com/u/HarryHighDef)\
**Post date:** [June 28, 2018, 8:33am UTC](https://forums.unrealengine.com/t/blueprint-math-expression-how-do-i-get-the-sign-of-a-value/428217/4 "2018-06-28T08:33:53Z")

</div>

> **[Math Expression Node](https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/Blueprints/UserGuide/MathNode/)**
>
> The math expression node allows you to type in a math expression and builds the appropriate sub-graph to create that expression.

The documentation tells all, seems like you will have to use .

No way to get the sign.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4b24d331](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4b24d331](https://forums.unrealengine.com/u/anonymous_user_4b24d331)\
**Post date:** [June 28, 2018, 11:40am UTC](https://forums.unrealengine.com/t/blueprint-math-expression-how-do-i-get-the-sign-of-a-value/428217/5 "2018-06-28T11:40:32Z")

</div>

The documentation does state the following though: “Blueprint pure functions that are in a coded function library should all be available.” (quote from the page you linked to). And guess what? `class ENGINE_API UKismetMathLibrary : public UBlueprintFunctionLibrary` has a function `UFUNCTION(BlueprintPure, meta=(DisplayName = "Sign (float)"), Category="Math|Float") static float SignOfFloat(float A);`.

I’m rather certain it would just work in math expression if it wouldn’t have the DisplayName meta specifier…
