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

Intersection of two paths given start points and bearings?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
miro



Joined: 15 Jan 2011
Posts: 62

View user's profile Send private message

PostPosted: Tue Mar 27, 2012 4:06 pm     Reply with quote

The pcwhd has float with 32bit, 48bit and 64bit precisions. Only 64bit fp may satisfy your requirements, though. A friend of mine tested the precision with the "9degree" test
"9degree" = asin(acos(atan(tan(cos(sin("9degree"))))))
and the only acceptable result was with 64bit fp. C18/C30 does it better.
For reference see http://www.rskey.org/~mwsebastian/miscprj/models.htm
PS: in case you need much higher precision and the speed is not the paramount you may consider the decNumber library http://speleotrove.com/decimal/decnumber.html
I "ported' it to stm32f100 (128k flash/8k ram) so it may fit into pic24/dspic33 parts easily. It does provide arbitrary precision math (up to 999,999,999 decimal digits, with exponents up to 9 digits) and it is precise enough, indeed Very Happy ..
John P



Joined: 17 Sep 2003
Posts: 331

View user's profile Send private message

PostPosted: Wed Mar 28, 2012 9:14 am     Reply with quote

It occurred to me that someone might make an add-on floating point unit that could do the calculation off-chip, to use with small processors, and if they were smart they'd make the interface easy to use. So I searched on <floating point math spi> and found this:

http://www.sparkfun.com/products/8129

20 bucks doesn't seem like a bad price.

Wait, I see that they've come out with a 64-bit chip for $25:
http://www.micromegacorp.com/umfpu64.html
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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