bitwise-or Questions
4
Solved
I have this C++ code in one of my programming books:
WNDCLASSEX wndClass = { 0 };
wndClass.cbSize = sizeof(WNDCLASSEX);
wndClass.style = CS_HREDRAW | CS_VREDRAW;
What does the single pipe do in ...
Bosket asked 15/4, 2012 at 16:56
4
Solved
Java has binary-or | and binary-and & operators:
int a = 5 | 10;
int b = 5 & 10;
They do not seem to work in Kotlin:
val a = 5 | 10;
val b = 5 & 10;
How do I use Java's bitwise op...
Vexation asked 27/1, 2018 at 9:45
1
Solved
There are usages of | which look more like function pipe-lining or chaining rather than a bitwise or, seen in combination with the c++20 ranges. Things like:
#include <ranges>
#include <ve...
Inarticulate asked 21/4, 2022 at 11:56
3
Solved
Here's what I've done:
93 | 199
which returns
223
I understand that this is because 0b1011101 | 0b11000111 is 0b11011111
However, suppose I want to do the reverse operation. How do I get 0b1...
Interval asked 4/11, 2014 at 3:2
5
I have two strings(with 1's and 0's) of equal lengths(<=500) and would like to apply Logical OR on these strings.
How should i approach on this. I'm working with c#.
When i consider the obviou...
Eulogia asked 6/3, 2016 at 12:0
2
Solved
In AVX there are two instructions to do a bitwise-or VORPD and VORPS. The docs say:
VORPD (VEX.256 encoded version)
DEST[63:0] <- SRC1[63:0] BITWISE OR SRC2[63:0]
DEST[127:64] <- SRC1[...
Helsinki asked 21/12, 2012 at 13:16
3
Solved
I'm trying to deal with bitboards, which requires me to set a particular bit in a 64-bit unsigned integer. To set bit i, I perform a bitwise OR with the bitboard in question, with a left shifted nu...
Randy asked 11/6, 2015 at 9:55
1
Solved
I was curious about the implementation and representation of NaN in both IEEE single- and double-precision floating points, and I found this implementation of an "is NaN" function. Namely:
int isn...
Lighting asked 18/9, 2014 at 6:4
6
Solved
I know that || represents the logical operation "or", but I'm curious if anyone knows the history of choosing that symbol. Was it just because it happened to be an unused symbol on the keyboa...
Bathyal asked 24/2, 2013 at 21:33
6
Solved
When I give to a variable such value: e = 17|-15; , I get -15 as an answer after compiling.I can't understand what arithmetic c++ uses. How does it perform a bit-wise OR operation on negative decim...
Lemmuela asked 14/1, 2013 at 21:22
4
I have the following exercise: The numbers n0 to n7 are bytes represented in binary system. The task is every bit to drop either to the bottom or if it meets another bit it stays above it. Here is ...
Doig asked 29/11, 2012 at 14:42
2
Solved
I'm fiddling around with bitwise operators in JavaScript and there is one thing I find remarkable.
The bitwise or operator returns 1 as output bit if one of the two input bits are 1. So doing x | ...
Alcheringa asked 11/7, 2011 at 12:29
2
Solved
Say I have this code:
unsigned int func1();
unsigned int func2();
unsigned int func3();
unsigned int x = func1() | func2() | func3();
Does C++ guarantee that func1() will be called first, then ...
Carpic asked 20/5, 2011 at 23:29
1
© 2022 - 2024 — McMap. All rights reserved.