operation « bit « Java Data Type Q&A





1. Porting C code; need help with bitwise operation and pointer syntax    stackoverflow.com

I have some C code that I'd like to port to java. I haven't done much C coding, but I was able to follow along up until this one function. If ...

2. Java + bitwise operation    stackoverflow.com

I have a long variable in java and am converting it to a binary string, like long var = 24; Long.toBinaryString(val); Now this prints only 7 bits, but I need to display all the ...

3. Bitwise operation in Java    stackoverflow.com

I have an array of bytes. I want to simulate corrupt data by changing one bit, two, and three bits. How do I do this?

4. JAVA bitwise operation help    stackoverflow.com

Lets say I have a number 345, I want to have so that I end up with 0345. I.e.

int i = 0345;
How can I take an existing number and shift it ...

5. bitwise operation class in Java    stackoverflow.com

is there a class that makes bitwise operation easier ? I need some methods that reads into integer the "value" of bits givem their offset and length (in a 32/64 bits byte ...

6. Bitwise operation substring in Java    stackoverflow.com

Imagine you'd have the binary or hex representation of a number. Let's take this:

int number  = 0xffffff;
// this would recover the third f, as a stand-alone value, value of third_f ...

7. Bitwise operation    stackoverflow.com

there is 4 properties and each one of them can be activated. To know which one is activated i receive an int value. Using bitwise and operation i get ...

8. bitwise operation question    coderanch.com

I basically understand the rule of bitwise operation, but still have a question. Can't a byte variable be put into the bitwise operation? e.g. byte b = 20; b = b >> 1; and get a compile error with "possible loss of precision." Is there any way to make the code work? Thanks in advance.

9. a bit operation exam    coderanch.com

Moving to the Java In General forum. I suggest that you first post your attempt at a solution and not ask others to provide a solution for you. Then people will be more willing to help you. Have you even looked at the Java 1.5 API of the Integer class for instance? [ March 29, 2007: Message edited by: Barry Gaunt ...





10. bit operation question    coderanch.com

I cannot answer your question, but I can get you started in the right direction. I don't remember everything I learned about bitwise operators a long time ago, but it is really not as hard as it seems. And any good tutorial on bit shifting will teach you what you need to know. A tutorial on this topic does not need ...

11. Bit Wise operation: shifting    java-forums.org

Hi, I have an integer array of size 90, the content of which is 0's & 1's (Basically a binary stream saved in an integer array) I need to process this data in 10 chucks, each of size 9, and prefix each chunk with a 7 bit data (0000000). This means, the original 9-bit data in array index 0 to 8 ...

12. Bitwise operation syntax not recognized?    java-forums.org

13. Need Help Urgent - Bit level operation    java-forums.org

Hi I have the following requirement: I have to find the position of the higher order bit for a given number. I am achiving it by the following method. for (int key = 0; key<32; key++) { result = ((given_number & 0x80000000) == 0) ? 0 : 1; system.out.println(result); given_number<<=1; } This works fine when the given_value is of type int. ...

14. operation with bits    forums.oracle.com

result &(1<<(i%16))) has error it should be as result & (1<<(i%16)) and what is the use (i%16) it could be simply i and result = myArray[0]+myArray[1]; // ---should not be 0000000101111111, hey for this pt i am not damn sure, Just check it . TO my idea myArray[0]+myArray[1] will first result in a byte and then only casted to long.

15. Question about bit operation    forums.oracle.com

1/ I know I can use << to translate from number of index to the binary number. But how can I translate from binary number to number of index? (e.g. 1024 translates to 10) 2/ How can I separate two bits in a number? (e.g. 144 translates to 128+16) 3/ How can I know that the number exists a required bit? ...

16. The actual action with bitwise operation?    forums.oracle.com

Hi there! I've been programming for some years, and now is actually the first time I really bump into the bitwise operator &. I'm understood that this operator compares an integer (or any other raw datatype) bit by bit, and does an AND operation. The thing that confuses me is when I wanted to create an easy way to use the ...





17. Problem with bits operation    forums.oracle.com

18. Operation bits    forums.oracle.com

Another conditional operator is ?:, which can be thought of as shorthand for an if-then-else statement (discussed in the Control Flow Statements section of this lesson). This operator is also known as the ternary operator because it uses three operands. In the following example, this operator should be read as: "If someCondition is true, assign the value of value1 to result. ...

19. how to do bitwise operation in EBCDIC format?    forums.oracle.com

Hi, I am trying to implement our legacy code in C to java. In C for iSeries, some bitwise operations is done which result is in ebcdic format. char c[0] = '0' c &= ~0x20 this results in '}' for C and ' ' for java. When I implemented the same code in java, it always results in ASCII format for ...