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

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -