To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > General Help > Math and Physics

Reply
 
Thread Tools Search this Thread Display Modes
Old 09-22-2009, 03:43 PM   #1
badaboom55
Member
 
Join Date: Jan 2006
Posts: 86
resolved [RESOLVED] Math.pow(myValue, 2) or (myValue * myValue)?

Does anyone know if there is any significant performance gains/losses when using the methods of the Math class vs. an Operator?

For example, if I'm just trying to square a number, are there any gains/losses in performance if I use Math.pow(myValue, 2) or just (myValue * myValue)?
badaboom55 is offline   Reply With Quote
Old 09-22-2009, 05:49 PM   #2
dudeqwerty
Senior Member
 
dudeqwerty's Avatar
 
Join Date: Mar 2005
Location: Bosnia
Posts: 1,624
myValue*myValue is more efficient as the Math class does not need to be called up. Plus if the value of myValue is known to the compiler it will probably get preprocessed.
__________________
New sig soon
dudeqwerty is offline   Reply With Quote
Reply

Tags
math, operator, performance

Go Back   Flash Kit Community Forums > General Help > Math and Physics

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:57 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.