CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

What is double?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
drolleman



Joined: 03 Feb 2011
Posts: 116

View user's profile Send private message

What is double?
PostPosted: Sun Jan 22, 2023 11:17 pm     Reply with quote

In the ide the double is in blue (defined), it compiles but in printf it outputs garbage. According to help double is undefined. Is it defined or not, and what does it convert to?
Ttelmah



Joined: 11 Mar 2010
Posts: 19535

View user's profile Send private message

PostPosted: Mon Jan 23, 2023 3:16 am     Reply with quote

This depends on the chip involved.

In the standard PIC12/16/18 compiler the manual says:
Quote:

double - A reserved word but is not a supported data type.

It is reserved, because it exists when using the PIC24/30/33.

Normally if you declare a variable as 'double', it will be generated as
a standard float32. Normally it works as such. How are you trying to
print this?. A quick test shows it merrily working with %f to print.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group