Created
April 21, 2012 16:06
-
-
Save glcoder/2438024 to your computer and use it in GitHub Desktop.
Utility sign function for Flixel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -Bbwur AdamAtomic-flixel-8989e50/org/flixel/FlxU.as AdamAtomic-flixel-8989e50-new/org/flixel/FlxU.as | |
--- AdamAtomic-flixel-8989e50/org/flixel/FlxU.as 2011-08-22 09:03:52 +0400 | |
+++ AdamAtomic-flixel-8989e50-new/org/flixel/FlxU.as 2012-04-21 20:04:29 +0400 | |
@@ -20,6 +20,18 @@ | |
} | |
/** | |
+ * Extract the sign of a number. | |
+ * | |
+ * @param Value Any number. | |
+ * | |
+ * @return In case Value < 0 returns -1, otherwise returns 1 | |
+ */ | |
+ static public function sign(Value:Number):Number | |
+ { | |
+ return (Value<0)?-1:1; | |
+ } | |
+ | |
+ /** | |
* Calculate the absolute value of a number. | |
* | |
* @param Value Any number. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment