Re: Convert a very long int value To Hex



In article <1188294106.209614.216350@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Ahmad Jalil Qarshi <Ahmad.Jalil.Qarshi@xxxxxxxxx> wrote:
Thanks all for your kind support. I have used the following code and
it worked fine.

unsigned long long val = 998796744563877ll;
printf("Hex is: %llX\n", val);

That's okay in that range of values, but the original
initializer you posted with had more digits, and using that pattern
could lead to problems with larger numbers. The 'll' modifier
on the literal is for -signed- numbers; if the literal exceeds
the range of -signed- long long then the value you get out
would be unspecified. If you use a 'ull' or 'ULL' modifier on
the literal, the behaviour would be well defined.
--
I was very young in those days, but I was also rather dim.
-- Christopher Priest
.



Relevant Pages

  • Re: Trouble with $key to HASH when Numeric
    ... the end of a string -- in other words, this pattern will always match ... and capture either 5 digits or nothing; 2) the pattern is anchored to ... modifier, which you do not). ...
    (comp.lang.perl)
  • Re: regular expression
    ... | newline in the subject string, respectively, as well as at the ... This is equivalent to Perl's /m modifier. ... Your pattern can only match if it starts matching at the beginning ... a question mark proceeding the first * ...
    (comp.lang.php)
  • Re: searching for franken
    ... with some whitespace in between? ... Note that the /m modifier does absolutely nothing for the pattern ...
    (comp.lang.perl.misc)
  • s replace p modifier
    ... I'd like to encapsulate each number in a textfile with dollar-signs. ... How can I get the exact pattern which was replaced by ... In the perl docs I read that the p preserve modifier would save the replaced ...
    (comp.lang.perl.misc)
  • Re: custom regexp modifiers
    ... Paul wrote: ... The "s" modifier applies only to dots in the pattern. ...
    (comp.lang.perl.misc)