# Light Sine??

0 favourites
• 9 posts
From the Asset Store
Immerse your quiz games with our 6 unique music loops, ranging from acoustic chill guitar to cute and upbeat style.
• I noticed in the debugger that Sine shows a lot of decimals, about 10 decimals.

is there a way to use only 1 or 2 decimals, thinking that that will be less CPU taxing?

thx

TL;DR: Is there a "Light Sine"?

• round(N * 100) / 100

for 2 decimals

1000 for 3 decimals

etc...

depends on when you do the rounding though... if you do it after the calculation it wont help :-)

But if you round and then use the number it should help.

• thanks a lot mr. elephant

cvp

• What's the right way?

I tried this:

1.- Output to Value

2.- Set "every tick", set sprite's Angle using the round(sprite.sine.value) formula

is that correct?

• CAPX:

capx

• It won't be less CPU taxing to display less decimals, it will just look neater.

• It won't be less CPU taxing to display less decimals, it will just look neater.This.

It's just us humans who need numbers to be displayed with as less digits as possible - as long as we are not talking about our income <img src="smileys/smiley36.gif" border="0" align="middle" />

• rats

Im trying to find a solution 'cause I'm experiencing high cpu usage, check this:

http://www.scirra.com/forum/topic75537_post451602.html#451602

• ## Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• as I said. it wont help you if you do the rounding after the calculation. It can only help you in cases where you use the rounded value alot afterwards.

E.g.

This:

roundedValue = round(12.123132165468798763213654) --> (roundedvalue = 12.12)

for i = 0 to i = 1000000

Do calculations on roundedValue

Would be faster then this:

for i = 0 to i = 1000000

Do calculations on 12.123132165468798763213654

But in your case (as the others mention) you will just add an extra calculation to the cpu cycle (the rounding)

• 9 posts