Keep sign when exponentiating variable?

Is there some function that keeps variables sign after exponentiating it or is this best way to do it:

Mathf.Pow(speedLocal.x, 2)*Mathf.Sign(speedLocal.x)

That is the best way to do it. Squaring any number will necessarily make it positive (as will any even power), so you will lose the information. Getting and multiplying by the sign using a built-in method is the most appropriate and fastest method.