Go to Post Wow, possibly a HPJIE*? How cool would that be? *High Paying Job In Electronics. - DonRotolo [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #12   Spotlight this post!  
Unread 04-02-2007, 11:27
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: printing FLOAT data type on the terminal window

Floats aren't necessarily bad if used in moderation. They don't take any more data memory than a long does as both float and double are 32 bits long. Floating point operations are emulated in software since there is no on-board FPU hardware. The math library linked in uses a modest amount of additional program memory - but there is a lot of program memory available. It doesn't cost any more program memory to do 1 or 1000 float operations once the library is linked in.

What a programmer needs to be aware of is that the software emulation of the floating point operations can take a lot of time. How much time? I wrote a program to test how many floats/second the library could support and it wasn't much... maybe a few 1000s/second and you'd be saturating the PIC. I'll have to go back and re-run the benchmark to remember exactly.

The float/double data type is 8 bits of signed exponent and 24 bits of data - so a 32 bit integer value actually has 8 bits more precision than a float.

As with anything, understanding its weaknesses as well as its strengths will allow you to make a well informed decision based upon tradeoffs. Personally, I try to avoid both longs and floats but sometimes it just makes more sense to use them vs anything else.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Com Terminal 1 Window Problem. groovy69 Programming 4 25-01-2007 22:58
Terminal Window teh_pwnerer795 Programming 1 02-01-2007 00:21
Terminal Window Idaman323 Programming 0 20-02-2006 19:28
Placement of the SLU-35 Terminal Lugs gumbyman-829 General Forum 8 03-02-2006 00:57
Is Terminal Window Evil? Fat Alex Programming 1 20-07-2004 10:57


All times are GMT -5. The time now is 04:14.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi