Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2004
    Posts
    3

    Unanswered: 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

  2. #2
    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

  3. #3
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •