Double 64 Bits WinAvr Previous  1, 2 All
Author Message
 Koshchi
 Posted: Nov 06, 2009 - 05:14 PM
 Joined: Nov 17, 2004 Posts: 15014 Location: Vancouver, BC
 Quote: > I see 9 decimal digits. 32 bit floats are good for about 8.5 Well, they are usually stated as 6...7 digits of precision. IEEE754 is 24 bits, so a little over 7 decimal digits at best. _________________Regards, Steve A. The Board helps those that help themselves.

 avra
 Posted: May 16, 2010 - 08:44 PM
 Joined: Nov 09, 2001 Posts: 288 Location: Serbia

 danni
 Posted: May 16, 2010 - 09:38 PM
 Joined: Sep 05, 2001 Posts: 2612
 avra wrote: I have just finished fix64 library for AvrCo Multitasking Pascal compiler www.e-lab.de/AVRco/index_en.html. It handles s31.32 fixed point numbers and covers range from -2147483648.000000000 to 2147483647.999999999. I guess that covers your demands quite well. I fear, it covers not the point, that it must be called from C code and compileable using Winavr. Peter

 avra
 Posted: May 17, 2010 - 02:28 PM
 Joined: Nov 09, 2001 Posts: 288 Location: Serbia
 danni wrote: I fear, it covers not the point, that it must be called from C code and compileable using Winavr. This is from the original post: cicciociccio wrote: Can you suggest me some library or in alternative any solutions in order to solve my issue? Besides, looking at free sources of fix32, he can implement C version of just +,-,*,/ for his own fix64 quite easy (if that is all he needs, and probably it is such a case). For example, I don't think that this is unreadable to an average C programer: Code: function fixAdd(const a, b: TFix): TFix; begin // add a and b with fixed point math   Return (a + b); end; function fixMul(const a, b: TFix): TFix; begin // multiply a and b with fixed point math   Return (longint((int64(a) * int64(b)) shr fixFractBits)); end;

 Bingo600
 Posted: May 18, 2010 - 03:58 PM
 Joined: Apr 25, 2004 Posts: 3930 Location: Denmark
 This thread (German) has an avr-gcc package 64 Bit float Emulator in C, IEEE754 compatibel http://www.mikrocontroller.net/topic/85256 You would need this archive http://www.mikrocontroller.net/attachme ... double.zip And replace avr_f64.c in the archive with this one http://www.mikrocontroller.net/attachme ... /avr_f64.c I just made a "test compile" , and it's around 21K Flash / 310 B Ram on a Mega32 /Bingo

 Display posts from previous:  All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 Jump to: Select a forum Forum index|--[AVR (8-bit) Technical Forums]|   |-- AVR forum|   |-- XMEGA forum|   |-- AVR Wireless forum|   |-- AVR GCC forum|   |-- AVR Studio 5 and Atmel Studio 6 forum|   |-- AVR studio 4 forum|   |-- AVRfreaks Academy forum|   |-- AVR Tutorials|--[AVR Software Framework]|   |-- AVR Software Framework|--[AVR32 (32-bit) Technical Forums]|   |-- AVR32 Linux Forum|   |-- AVR32 General (standalone)|   |-- AVR32 Software Tools|   |-- AVR32 Hardware|--[General Electronics Technical Forums]|   |-- General Electronics|   |-- Atmel Security Products|--[Non-technical forums]|   |-- AVRfreaks.net Housekeeping|--[Non-topical forums]|   |-- Off-topic forum|   |-- AVRfreaks Trading Post
All times are GMT + 1 Hour