View previous topic :: View next topic |
Author |
Message |
vty0207
Joined: 17 Nov 2008 Posts: 2
|
does ccs support double precision floating point number? |
Posted: Mon Nov 17, 2008 3:04 am |
|
|
does ccs support double precision (64 bit) floating point number ?
I need 8-9 significant digit after the floating point. Eg. 3.141592654. |
|
|
PICoHolic
Joined: 04 Jan 2005 Posts: 224
|
|
Posted: Mon Nov 17, 2008 3:50 am |
|
|
The manual says:
Quote: | double is a reserved word but is not a supported data type. |
But if write down:
Code: | double p = 3.1415123; |
it compiles under 4.082
mmm.... |
|
|
Ttelmah Guest
|
|
Posted: Mon Nov 17, 2008 4:02 am |
|
|
Double is just treated as an alias for float. So it'll compile, but not give you any extra accuracy, _unless_ you are using PCD. On these chips, double is supported.
If you look in the maths include file, you will find a whole suite of 'overloads' for the 64bit functions, that only only apply if your compiler is PCD.
Best Wishes |
|
|
vty0207
Joined: 17 Nov 2008 Posts: 2
|
|
Posted: Mon Nov 17, 2008 7:18 pm |
|
|
What is PCD ? Is there another solution that I can process and calculate double precision (64 bit) floating point number ? Is switching to another compiler a solution ? |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Mon Nov 17, 2008 11:49 pm |
|
|
Yes, PCD is supporting double according to the manual. But I didn't yet use it. |
|
|
|