473,326 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

LLONG_MAX vs ULLONG_MAX

Hello,

Can anyone confirm which one is which: it seems that ULLONG_MAX is only
c99, whereas LLONG_MAX is c89. It doesn't make much sense since I would
expect both would be defined *or* none of them.

Thanks for confirmation
Mathieu
Jul 22 '05 #1
3 4975
Mathieu Malaterre wrote in
news:l%********************@twister.nyroc.rr.com in comp.lang.c++:
Hello,

Can anyone confirm which one is which: it seems that ULLONG_MAX
is only
c99, whereas LLONG_MAX is c89. It doesn't make much sense since I
would expect both would be defined *or* none of them.


Wrong newsgroup, neither of the above are part of C++.

Ask in comp.lang.c (Note *no* ++).

Rob.
--
http://www.victim-prime.dsl.pipex.com/
Jul 22 '05 #2
"Rob Williscroft" <rt*@freenet.co.uk> wrote...
Mathieu Malaterre wrote in
news:l%********************@twister.nyroc.rr.com in comp.lang.c++:
Hello,

Can anyone confirm which one is which: it seems that ULLONG_MAX
is only
c99, whereas LLONG_MAX is c89. It doesn't make much sense since I
would expect both would be defined *or* none of them.

Wrong newsgroup, neither of the above are part of C++.


True. But C89 (C90, actually) _is_. And LONG_MAX and ULONG_MAX are
also part of C++. We can only conclude that LLONG_MAX is _not_ part
of C89. So, essentially, Mathieu is correct, neither of them is in
C89 (C90) and both are in C99.
Ask in comp.lang.c (Note *no* ++).


Wouldn't hurt.

V
Jul 22 '05 #3
Mathieu Malaterre wrote:
Hello,

Can anyone confirm which one is which: it seems that ULLONG_MAX is
only c99, whereas LLONG_MAX is c89. It doesn't make much sense since I
would expect both would be defined *or* none of them.

Thanks for confirmation
Mathieu


D:\>type longlongint.c
#include <stdlib.h>

int main() {
long long int a;
unsigned long long int b;

return EXIT_SUCCESS;
}
D:\>gcc -Wall -ansi -pedantic longlongint.c
longlongint.c: In function `main':
longlongint.c:4: warning: ISO C90 does not support `long long'
longlongint.c:5: warning: ISO C90 does not support `long
long' longlongint.c:4: warning: unused variable `a'
longlongint.c:5: warning: unused variable
`b'
In c99 standard, 5.2.4.2.1 Size of integer limits ,

"
— maximum value for an object of type long long int
LLONG_MAX +9223372036854775807 // 2^63 - 1
— maximum value for an object of type unsigned long long int
ULLONG_MAX 18446744073709551615 // 2^64 - 1
"

So since those types are not defined in c89, the two macros could not
have been defined in c89 either.

--
Karthik. http://akktech.blogspot.com .
' Remove _nospamplz from my email to mail me. '
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Mark Shelor | last post by:
Problem: find a portable way to determine whether a compiler supports the "long long" type of C99. I thought I had this one solved with the following code: #include <limits.h> #ifdef...
13
by: Ioannis Vranos | last post by:
Hi all, Is long long supposed to be supported in all C99 implementations?If yes is it supposed to be 64 bit at least? GCC says that it supports long long, but i got this: #include <stdio.h>...
25
by: Joakim Hove | last post by:
Hello, I have code which makses use of variables of type size_t. The code is originally developed on a 32 bit machine, but now it is run on both a 32 bit and a 64 bit machine. In the code...
1
by: Ravi Uday | last post by:
Hi, I have this in my limits.h file. #if __INT_BITS__-0 == 64 #define LLONG_MIN (-9223372036854775807-1) /* minimum value of a long long */ #define LLONG_MAX 9223372036854775807 ...
9
by: Simple Simon | last post by:
Java longs are 8 bytes. I have a Java long that is coming in from the network, and that represents milliseconds since Epoch (Jan 1 1970 00:00:00). I'm having trouble understanding how to get it...
2
by: Schraalhans Keukenmeester | last post by:
The header file limits.h contains the following: #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* Minimum and maximum values a `signed long long int' can hold. */ # undef...
20
by: Junmin H. | last post by:
Hello, I am trying to print the range of unsigned char and unsigned int. The one for char is working good, gives me a correct output, however the other one for int doesnt, why?? Thanks #include...
26
by: kerravon | last post by:
The following C program: int main(void) { int x = -2147483648; return (0); } Produces the following warning:
3
by: Blue sky | last post by:
Hi,I am a new C++ learner.The follow prgram produces a wrong result,but I can't find the wrong.Can you help me?Thank you! #include<stdio.h> long factorial( long number); int main() { int...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.