Results 1 to 3 of 3

Thread: Ranges for each and every datatypes in Java

  1. #1
    Geek_Guest
    Guest

    Ranges for each and every datatypes in Java

    Question asked by visitor sesi

    Can anybody specifically (in figures) tell me about the ranges for each and every datatypes in java?


  2. #2
    Junior Member
    Join Date
    Apr 2007
    Answers
    1

    Re: Ranges for each and every datatypes in Java

    we have an formula for calculating the data types.
    for lower range is -2 to the power of(bits-1) to 2 to the power of (bits-1) -1


  3. #3
    Contributing Member
    Join Date
    Feb 2007
    Answers
    47

    Re: Ranges for each and every datatypes in Java

    Primitive Type Size Range of Values
    byte 8 bit -2^7 to 2^7-1
    16 bit -2^15 to 2^15-1
    int 32 bit -2^31 to 2^31-1
    long 64 bit -2^63 to 2^63-1
    char 16 bit '\u0000' to '\uffff'(0 to 2^16-1 )
    float 32 bit Max. positive value: (2-2^-23)*2^127. Min. positive value: 2^-149
    double 64 bit Max. positive value: (2-2^-52)*2^1023. Min. positive value: 2^-1074

    Last edited by neelim; 04-05-2007 at 04:28 AM. Reason: Formatting

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact