Use of extern in in the implementation of double floats from an external library

Hi All,

Thanks for the assistance. I now have AVR_F64 running.

For the record Ifound the reference in a post in avrfreaks - towards the bottom by Bingo600 May 18, 2010 which gives the reference to the original at mikrocontroller.net at:
http://www.mikrocontroller.net/topic/85256

This is a German site and it helps if you have some skills in Deutsch. Google translate does not do a bad job though. Work was done by another on this system to provide some optimization of speed vs size and there is an updated .c file at:
http://www.mikrocontroller.net/attachment/51020/avr_f64.c

If you want to use this library from the Arduino IDE it needs some editing of the .h file. For those who might be interested here is the .h file with the extern statement in a place where it works. (There may be a better place - I am no expert). Note also I have enabled all of the functions. Each function can be turned on or off with an #DEFINE but if you want to experiment this is a nuisance. To turn these off just comment out the #DEFINE associated with the unwanted function. I have attached the .h file.

I read through the .c code as well and there are many comments in German. I have translated these to my ability and I hope they are of assistance to someone. I used Google translate but also applied a sanity test. Google translate struggles where there are computer variables interspersed with the description. If there are native speakers of German with the requisite English and C skills I am sure that they could do a better job than me. Attached is the c file with the German and translated comments in parallel.

Finally I built a table of the functions and what they do as a reference. It is attached as a excel spreadsheet.

Returning to the comments:

Thanks to David Oconnor and PaulS. I have read both the short and long explanations and am somewhat wiser. This space has many traps for neophytes.

Should most of my application require a decent double floating capability and speed I can only agree with MichaelMeissner that a better solution would be one based on a processor with an inherent hardware capability and there are many of these including the raspberry PI. (I have a couple of these but not doing process control stuff). However in the case in point the calculations are very few and far between and could be done sequentially through loop() a chunk at a time so that the processor is not slugged with a massive demand. This will be quite satisfactory in this application as the result is not needed instantly. If the problem were more intensive a better processor would be indicated. As to the 3.3V vs 5 V issue I have that already only going from 5 to 3.3 in this application. I expect to see more of this. Thanks also to jremington whose German looks to be better than mine.

Thanks again for all the help.
Regards,
Fred.

avr_f64.h (14.6 KB)

avr_f64.c (63.5 KB)

functions.xlsx (15.6 KB)