If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > C Data types - high floating point precision

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-28-04, 05:15
beuls beuls is offline
Registered User
 
Join Date: Jun 2004
Posts: 3
C Data types - high floating point precision

Hi,

I have a doubt in C. I calculate a value which has a floating point precision about 15 digits eg. 0.000000000000000045. If I use float or double with control strings %f or %lf, I receive the value as 0. How to proceed with this. Your help is greatly appreciated.

Regards,
Beulah
Reply With Quote
  #2 (permalink)  
Old 09-16-04, 05:38
twokai twokai is offline
Registered User
 
Join Date: Sep 2004
Posts: 8
#include<stdio.h>

void main()
{
float a=0.000000000000015;
printf("%0.15f",a);
}

hope u will find this useful.i did this in visualc++ compiler
Reply With Quote
  #3 (permalink)  
Old 09-16-04, 12:06
sundialsvcs sundialsvcs is offline
Registered User
 
Join Date: Oct 2003
Posts: 706
If possible, such a number should be presented in scientific notation. Saves counting all those zeroes...
__________________
ChimneySweep(R): fast, automatic
table repair at a click of the
mouse! http://www.sundialservices.com
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On