• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

length of int

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
Relatively silly question:
Is it vital to memorize the max and min values for int? or will it suffice to know that it goes from (- 2^32) to ((2^32) - 1)
In the exam, is it truly necessary to memorize everything, or will complete understanding of concepts suffice?
Thanks for the help
Kris
 
Ranch Hand
Posts: 464
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Kris..
Well for Byte,Short,Int,Long
you dont have memorize all their max/min values
Instead there is a shortcut
Memorize this formula
-2^(n-1) to 2^(n-1) -1
Plug in any of those Integrals you will get their max/min values
BTW: for Int its -2^31 to -2^31 -1
Thankyou
Ragu
 
Kris Decker
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanx! I realized that I had made a mistake on the vals

Originally posted by Ragu Sivaraman:
Hello Kris..
Well for Byte,Short,Int,Long
you dont have memorize all their max/min values
Instead there is a shortcut
Memorize this formula
-2^(n-1) to 2^(n-1) -1
Plug in any of those Integrals you will get their max/min values
BTW: for Int its -2^31 to -2^31 -1
Thankyou
Ragu


 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But do you need to know the range for float and double? they are really hard to memorize.
Thanks
 
reply
    Bookmark Topic Watch Topic
  • New Topic