• Advertisement
Sign in to follow this  

Maximum value of a long short?

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
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.

Share this post


Link to post
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 this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Perhaps you're thinking of a long double?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
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 this post


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

Share this post


Link to post
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 this post


Link to post
Share on other sites
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++.

Share this post


Link to post
Share on other sites
Quote:
Original post by igni ferroque
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


Which may also be spelled short, int and long.

Quote:
, 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


In C++, those are spelled [std::numeric_limits<short>::min(),std::numeric_limits<short>::max()], [std::numeric_limits<int>::min(),std::numeric_limits<int>::max()],
[std::numeric_limits<long>::min(),std::numeric_limits<long>::max()], and limits (no .h), respectively. :)

Share this post


Link to post
Share on other sites
Is there such thing as a 'short long'? A 'short short'? Probably not...

Share this post


Link to post
Share on other sites
I believe that in C99, "long short" is a typedef for "capris".

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement