Go Down

Topic: For loop initializer, and increment (Read 577 times) previous topic - next topic

ajofscott

May 06, 2012, 10:55 pm Last Edit: May 06, 2012, 10:58 pm by Coding Badly Reason: 1
Does 'for(;;)' accept floats? Or will Inflate to integers then downscale within the loop code for use in calculations?

Coding Badly


for does not care about data-types.

ajofscott

I was curious because my polar functions returned abnormally fast, ie the mechanics didn't move at all. i did however note that I had not explicitly typcast back to integer when saving the results to my integer based coordinate points.

James C4S


Does 'for(;;)' accept floats? Or will Inflate to integers then downscale within the loop code for use in calculations?


From the for() reference page (http://arduino.cc/en/Reference/For):
"Also the statements for initialization, condition, and increment can be any valid C statements with unrelated variables, and use any C datatypes including floats."
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy