What is the meaning 0xfb00000000000LL

Discussion in 'C++' started by parag_paul, Oct 3, 2007.

  1. parag_paul

    parag_paul Guest

    What is the purpose of the LL in the end , Any way it is long long
    parag_paul, Oct 3, 2007
    1. Advertisements

  2. parag_paul

    Guest Guest

    If you do not put the LL at the end it will be treated as a literal int,
    for which the value is too big so you would not get the value you
    expected. Notice also that long long is not part of the current standard
    (but will be in the next).
    Guest, Oct 3, 2007
    1. Advertisements

  3. parag_paul

    Markus Moll Guest

    No, currently the type is chosen as the first one that is big enough in the

    int, long int (for decimal literals)
    int, unsigned int, long int, unsigned long int (for octal and hexadecimal

    If it does not fit into the largest type, strictly speaking, the program is
    ill-formed. However, I would expect any reasonable compiler to support long
    long already.

    The suffixes are useful mainly if you want to denote e.g. a small long:

    void f(int);
    void f(long);

    f(3L); // call the long overload

    Markus Moll, Oct 3, 2007
  4. parag_paul

    Old Wolf Guest

    This seems to be a fairly common misconception
    (i.e. if the suffix is omitted, the value is
    treated as an int regardless) - does anyone
    know where it came from?
    Old Wolf, Oct 3, 2007
  5. parag_paul

    Ben Pfaff Guest

    Perhaps it is because most integer constants have type int? I
    imagine that programmers just extrapolate from "most" to "all".
    Ben Pfaff, Oct 3, 2007
  6. Probably from compiler bugs.
    Gianni Mariani, Oct 4, 2007
  7. parag_paul

    James Kanze Guest

    The purpose of the LL is to make it a long long. Otherwise, the
    type depends on the machine---on my machines, it's a long.
    James Kanze, Oct 4, 2007
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.