Find the answer to your Linux question:
Results 1 to 7 of 7
Hey can anyone tell me how to get around fraction in this calculation? I am just feeling stupid about this...my friend told me to convert this 1.36 MB to a ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2005
    Posts
    44

    how to get around fraction?


    Hey can anyone tell me how to get around fraction in this calculation?
    I am just feeling stupid about this...my friend told me to convert this
    1.36 MB to a Byte value without fraction but whatever I am doing, it still giving me a fractional result.

    can anyone tell me what should I do to get around a fractional value?
    stupid right?

  2. #2
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    converting that to bytes shouldn't get a fraction. should still bet a full digit of bytes.

    1.36MB = 1.36*1024KB = 1.36*1024*1024 Bytes = 1447034.88Bytes.

    this works out as 11576279bits.

    So it's a valid file size i work out!
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  3. #3
    Just Joined!
    Join Date
    May 2005
    Posts
    44
    hey how do you get this? I didnt get it.
    1.36 MB=1.36*1024*1024=1426063.36 whereas you are getting
    1.36MB = 1.36*1024KB = 1.36*1024*1024 Bytes = 1447034.88Bytes.

    I may assume that there is an calculation mistake but still one thing isnt clear to me. that is how this 1447034.88 Bytes works out as 11576279bits?

    can you please explain?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Enthusiast
    Join Date
    Jun 2005
    Location
    Odessa, FL
    Posts
    586
    Quote Originally Posted by hassanLinux
    hey how do you get this? I didnt get it.
    1.36 MB=1.36*1024*1024=1426063.36 whereas you are getting
    1.36MB = 1.36*1024KB = 1.36*1024*1024 Bytes = 1447034.88Bytes.

    I may assume that there is an calculation mistake but still one thing isnt clear to me. that is how this 1447034.88 Bytes works out as 11576279bits?

    can you please explain?
    1 byte = 8 bits
    so...1447034.88 bytes x 8 = 11576279 bits

  6. #5
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    Quote Originally Posted by hassanLinux
    hey how do you get this? I didnt get it.
    1.36 MB=1.36*1024*1024=1426063.36 whereas you are getting
    1.36MB = 1.36*1024KB = 1.36*1024*1024 Bytes = 1447034.88Bytes.
    Start with 1.36MB

    To convert to KB, multiply by 1024.
    (1.36*1024)

    To convert to Bytes, multiply by another 1024
    (1.36*1024*1024)

    This gives you the 1447034.88Bytes.

    Then as josolanes said, 8 bits = 1 Byte.

    So to get into bits, multiply by a further 8

    1426063.36 * 8 = 11576279 bits.
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  7. #6
    Just Joined!
    Join Date
    May 2005
    Posts
    44

    how to get around fraction in byte result?

    hey guys

    whatever you folk doing, I am doing the same but what is confusing is; my result after converting 1.36 MB to bytes is 1426063.36 bytes whereas yours is 1447034.88 bytes.

    Again I know that 8 bit=1 byte. but my original question was, I want a byte value(not a bit value) without fraction. Just like in an operating system it always shows without fraction. And now I guess I need to do some florring celling to get around this.

    What do you think?

  8. #7
    Linux User Krendoshazin's Avatar
    Join Date
    Feb 2005
    Location
    London, England
    Posts
    471
    Here's how I did it.

    We know that 1MB is 1024KB, so we can forget about the 1MB and work on the 0.36MB, now, knowing that 1MB (1 whole), in this case, is 1024, you divide 1024 by 100 and you get 10.24, multiply that by 36 (36% of the whole) and you get 368.64.
    So now we have 1 whole and 36%, 1024KB and 368.64KB, add those together which comes to 1392.64KB, 1.36MB = 1392.64KB, 1024B per KB, 1392.64 x 1024 = 1426063.36.

    There's no such thing as .36 of a byte as we need 8 binary digits in order to represent a character on a scale of 256 possibilities per byte ( 2^8 ), so just round it off and you've got 1,426,063 Bytes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •