Bits and Bytes





8
Date Submitted Thu. Feb. 23rd, 2006 1:10 PM
Revision 1 of 1
Coder mattrmiller
Tags Bits | Bytes | Constants | Java
Comments 0 comments
I needed these for a recent project, bits and bytes constants.


        private static final double BITS_KILLA = 1000;
        private static final double BITS_MEGA = Math.pow(BITS_KILLA, 2);
        private static final double BITS_GIGA = Math.pow(BITS_KILLA, 3);
        private static final double BITS_TERRA = Math.pow(BITS_KILLA, 4);
        private static final double BITS_PETA = Math.pow(BITS_KILLA, 5);
        private static final double BYTES_KILLA = 1024;
        private static final double BYTES_MEGA = Math.pow(BYTES_KILLA, 2);
        private static final double BYTES_GIGA = Math.pow(BYTES_KILLA, 3);
        private static final double BYTES_TERRA = Math.pow(BYTES_KILLA, 4);
        private static final double BYTES_PETA = Math.pow(BYTES_KILLA, 5);

 

Matthew R. Miller

www.bluecreststudios.com
=================
Matthew R. Miller

http://bluecreststudios.com
http://www.codeandcoffee.com

Comments

There are currently no comments for this snippet.

Voting