How to get the limit on it's range of the double type?

Discussion in 'C Programming' started by Viery, Mar 6, 2004.

  1. Viery

    Viery Guest

    Hi,
    I want to write some codes to get the limit of range in real
    number.
    Could you please give me some sample? Because I am not familiar
    with C language.

    Thanks,
    Viery
    Viery, Mar 6, 2004
    #1
    1. Advertising

  2. Emmanuel Delahaye, Mar 6, 2004
    #2
    1. Advertising

  3. Viery

    Malcolm Guest

    "Viery" <> wrote in message
    > Hi,
    > I want to write some codes to get the limit of range in real
    > number.
    > Could you please give me some sample?
    >

    #include <float.h>
    #include <stdio.h>

    int main(void)
    {
    printf("Biggest double %g\n", DBL_MAX);
    printf("Smallest fraction %g\n", DBL_MIN);
    printf("Decimal precison %d digits\n", (int) DBL_DIG);
    return 0;
    }
    Malcolm, Mar 6, 2004
    #3
  4. Viery

    Joe Wright Guest

    Malcolm wrote:

    > "Viery" <> wrote in message
    >
    >>Hi,
    >> I want to write some codes to get the limit of range in real
    >>number.
    >> Could you please give me some sample?
    >>

    >
    > #include <float.h>
    > #include <stdio.h>
    >
    > int main(void)
    > {
    > printf("Biggest double %g\n", DBL_MAX);
    > printf("Smallest fraction %g\n", DBL_MIN);
    > printf("Decimal precison %d digits\n", (int) DBL_DIG);
    > return 0;
    > }
    >
    >

    Why the cast? DBL_DIG is int.

    --
    Joe Wright mailto:
    "Everything should be made as simple as possible, but not simpler."
    --- Albert Einstein ---
    Joe Wright, Mar 6, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sydex
    Replies:
    12
    Views:
    6,453
    Victor Bazarov
    Feb 17, 2005
  2. Replies:
    1
    Views:
    1,069
    Victor Bazarov
    Jun 28, 2005
  3. nicknack

    limit date range with calendar

    nicknack, Mar 11, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    892
    nicknack
    Mar 12, 2007
  4. Replies:
    2
    Views:
    288
  5. DFS
    Replies:
    133
    Views:
    1,535
    Tim Rentsch
    Jun 12, 2014
Loading...

Share This Page