optimization - Cheapest way of making a number negative in Javascript -


I'm building a physics engine in JavaScript. I am reading some articles about operational costs in connection with the use of CPU, but I am not getting the answer to this problem. I want to make a "negative" I have come up with two different solutions:

  a * = -1;   

or

    / div> 

This seems over-optimization.

I will go for another because it is small

  a * = - 1; // 5 a = -a; // 4    

Comments

Popular posts from this blog

php - how to change mysql_result($res, 0, "url"); to mysqli -

c# - Textbox not clickable but editable -

Matlab transpose a table vector -