Public Group

# Maximum value of a long short?

This topic is 4703 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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.

##### Share on other sites
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.

##### Share on other sites
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

##### Share on other sites
Quote:
 Original post by MizipzorHow 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.

##### Share on other sites
Perhaps you're thinking of a long double?

##### Share on other sites
Quote:
 Original post by MizipzorWell... 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

##### Share on other sites
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.

##### Share on other sites
the range of values of any unsigned integer number is 0 to 2number_of_bits_in_variable - 1.

##### Share on other sites
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

##### Share on other sites
Quote:
 Original post by MizipzorWell... 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++.

1. 1
Rutin
62
2. 2
3. 3
4. 4
5. 5

• 13
• 10
• 29
• 20
• 9
• ### Forum Statistics

• Total Topics
633412
• Total Posts
3011754
• ### Who's Online (See full list)

There are no registered users currently online

×