- Home /
Question by
RGI · Aug 25, 2013 at 10:51 AM ·
javascriptmathexponential
Unity Exponentiation question.
How do I write this down as a javascript in unity? I cant find a sign for that "12" thingy.
expon.png
(1.0 kB)
Comment
Best Answer
Answer by TheKusabi · Aug 25, 2013 at 02:09 PM
I'm not 100% with javascript. But you can either use ^ as in 10^12, or if that sybol isn't used in Javascript, there should be Mathf.Pow( ).
So it's either:
Variable = 10^12;
or
Variable = Mathf.Pow(10, 12);
the ^symbol is for a bitwise XOR. $$anonymous$$athf.Pow will work.
yeah, I tried ^ before asking this. $$anonymous$$athf.Pow works, thank you.