Questions tagged [operand]
177 questions
30
votes
3 answers
bad operand types for binary operator "&" java
The error shows this line
if ((a[0] & 1 == 0) && (a[1] & 1== 0) && (a[2] & 1== 0)){
This is the whole code:
public class Ex4 {
public static void main(String[] args) {
int [] a = new int [3];
if(args.length == 3)
{
try{
…

user3364498
- 489
- 1
- 9
- 14
30
votes
5 answers
TypeError: unsupported operand type(s) for /: 'str' and 'str'
name = input('Enter name here:')
pyc = input('enter pyc :')
tpy = input('enter tpy:')
percent = (pyc / tpy) * 100;
print (percent)
input('press enter to quit')
whenever i run this program i get this
TypeError: unsupported operand type(s) for /:…

Deric miller
- 417
- 1
- 5
- 7
26
votes
3 answers
Error 'rm: missing operand' when using along with 'find' command
I see that this question is getting popular.
I answered my own question below.
What says Inian is correct and it helped me to analyze my source code better.
My problem was in the FIND and not in the RM. My answer gives a block of code, which I am…

aPugLife
- 989
- 2
- 14
- 25
22
votes
4 answers
mkdir -p in Mac
I have been reading the description of the OSX Man page. It has description like following regarding mkdir -p:
-p
Create intermediate directories as required. If this option is not specified, the full path prefix of each operand must already…

user454083
- 1,337
- 3
- 16
- 31
20
votes
2 answers
C++ using square brackets with pointer to instance
I've created a singleton class which uses GetInstance() method to get the instance address (pointer).
Inside the class i have an array of unsigned long int which i've created the operator [] for it (direct access to the array).
How can i use the…

SagiLow
- 5,721
- 9
- 60
- 115
11
votes
5 answers
MySQL Error "Operand should contain 1 column"
I could find a lot of similar questions but no real solution for my problem.
My SQL query:
UPDATE ADRESSEN
SET EMAIL = 0
WHERE ID = (SELECT ID, COUNT(ID) AS COUNTER
FROM EIGENSCHAFTEN WHERE Kategorie = "BOUNCE"
GROUP BY ID
HAVING COUNTER = 1)
The…

jacob
- 127
- 1
- 1
- 5
11
votes
4 answers
Python - Unsupported type(s) : range and range
I'm getting this strange error trying to run a script, the code appears to be correct but it seems python (3) didn't liked this part:
def function(x):
if integer:
return int(x)
else:
…

Monk
- 111
- 1
- 1
- 4
10
votes
2 answers
What are the academic names for the left and right operands in binary relational operator?
Relational operators such as <, >=, == are often not bidirectional. What are the correct names for the operands to these operators? An example from an non-relational operator, division, would be the operand names divisor and dividend.

Matt Joiner
- 112,946
- 110
- 377
- 526
10
votes
1 answer
Mysql ERROR 1241 (21000): Operand should contain 1 column(s)
I have Customer Groups with Number-Ranges (from Customernumber, to Customernumber).
select g.id,
(select count(*), sum(sales)
FROM transactions t1
where t1.customernumber between g.from_customernumber and g.to_customernumber)
from customer_groups…

Marco
- 3,470
- 4
- 23
- 35
10
votes
2 answers
unsupported operand type(s) for *: 'numpy.ndarray' and 'numpy.float64'
long time reader, first time writer.
I searched around on google and stack overflow, but wasn't really able to find a general answer to this question.
I am getting an "unsupported operand type(s) for *: 'numpy.ndarray' and 'numpy.float64'" error in…

Jason
- 103
- 1
- 1
- 6
10
votes
4 answers
Integer division & modulo operation with negative operands in Python
Questions arise when I type in these expressions to Python 3.3.0
-10 // 3 # -4
-10 % 3 # 2
10 // -3 # -4
10 % -3 # -2
-10 // -3 # 3
It appears as though it takes the approximate floating point (-3.33)? and rounds down either way in integer…

tlands_
- 176
- 1
- 10
8
votes
1 answer
error X8000 : D3D11 Internal Compiler error : Invalid Bytecode: Invalid operand type for operand #1 of opcode #86 (counts are 1-based)
I'm absolutely stumped as well as my instructors/lab-assistants.
For some reason, the following HLSL code is returning this in the output window:
error X8000 : D3D11 Internal Compiler error : Invalid Bytecode: Invalid operand type for operand #1 of…

JMazzola
- 105
- 1
- 5
7
votes
6 answers
Using IF, AND, OR together with EQUAL operand together in Python
I'm trying to create a function where the given value (passed as a string) is checked to see if the number of digits is either 4 or 6, and that it is a number.
My first impulse was to go with this code:
def number(x):
if (len(x) == (4 or 6))…

jhub1
- 611
- 3
- 7
- 19
5
votes
1 answer
In C, for example, why is second operand of shift allowed to be signed?
Note: This question is all about the signedness of the second operand of bit shift operators << and >>. Not at all about the first operand.
CERT INT34-C, in part: Do not shift a negative number of bits ...
Not that it needed justification, but they…

talkaboutquality
- 1,312
- 2
- 16
- 34
5
votes
2 answers
postfix (prefix) increment, L-value and R-value (in C and C++)
I just learned the following facts:
The result of a prefix increment (++var_name) is an R-value in C (at least, I am
sure that it is not a L-value in C), but it is an L-value in C++.
The result of a postfix increment (var_name++) is an R-value…

user565739
- 1,302
- 4
- 23
- 46