Jump to content
  • Advertisement
Sign in to follow this  
Mizipzor

Maximum value of a long short?

This topic is 4610 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
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!