Thread: Syntax Error!
View Single Post
  #15   Spotlight this post!  
Unread 04-02-2006, 19:47
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Syntax Error!

Quote:
Originally Posted by CronosPrime1
Yes, it is always very important to make sure you declare things with the right type. However, when you write something like 3.142, the computer knows you want a float. In fact, the computer even treats 15.0 as a float. Why else would you have put the decimal point if not to mean that you want a float?
Most C languages treat constants with decimal points as double by default - hence the "X.XXf", to specify only a 32 bit FP is needed. I think PIC C uses float by default, but it's habit from my desktop C background. Doesn't hurt.