|
From: Per W. <pw...@ia...> - 2007-06-07 17:11:23
|
Oops, missed the meaning of your question. Look at the file <limits.h> - it contains a lot of defines for numeric ranges for different data types (char, short, int, long, ...) /pwm On Thu, 7 Jun 2007, Philip Bennefall wrote: > Hi, > Could anyone tell me the formula which is used to calculate the min and max values for a numerical data type of x bytes? Say for instance that I use the > sizeof(datatype) function and get the answer 4, which is usually an integer, how do I then programatically calculate the min and max values for a signed > and unsigned version of the data type respectively. > > Thanks in advance. > > Regards > Philip Bennefall |