Maximum value of a long short?

Started by
11 comments, last by Sneftel 18 years, 4 months ago
How do I find out the maximum value of a long short? Im doing a neural net and the weight keeps getting higher until I get unhandled exception, so I figured I tried to store a value to high for a long short. Last working value was something like 7.09210000.
Advertisement
long short? That doesn't sound like a data type in any language I've heard of, especially since you're putting floating point values in it.
Well... the compiler seemed to have no problems with it. :P Then, what datatype lets me store the largest possible number? A float that is... which means it has decimals right? :P
Quote:Original post by Mizipzor
How do I find out the maximum value of a long short?

Im doing a neural net and the weight keeps getting higher until I get unhandled exception, so I figured I tried to store a value to high for a long short. Last working value was something like 7.09210000.


long short?

my compiler( g++ ) wont even allow it.

Perhaps you're thinking of a long double?
Quote:Original post by Mizipzor
Well... the compiler seemed to have no problems with it. :P Then, what datatype lets me store the largest possible number? A float that is... which means it has decimals right? :P


long long for integer values,

long double for decimals
Since you still haven't mentioned what programming language you're using, I'm going to assume that you are using (*spins wheel*) Visual Basic 6. Then your best bet would be to try the Currency type which holds quite large numbers as well as allows small increments to be made.
the range of values of any unsigned integer number is 0 to 2number_of_bits_in_variable - 1.
for laughs, i tried a long long long variable.

error message:
Quote:source g++
31 C:\Programming\c++\Ogl2Dtest\main.cpp `long long long' is too long for GCC
Quote:Original post by Mizipzor
Well... the compiler seemed to have no problems with it.


Get a new one, yours is broken.

Your choices are short int, int, and long int, holding [SHRT_MIN,SHRT_MAX], [INT_MIN,INT_MAX], and [LONG_MIN,LONG_MAX] respectively, and their corresponding unsigned types. See the limits.h header. long long was not added until C99, and is not part of ISO C++.
Free Mac Mini (I know, I'm a tool)

This topic is closed to new replies.

Advertisement