Questions tagged [operands]

Operands are values acted upon by an operator, method, or other functional entity.

Operands differ from parameters in that they are the real values used or altered by a function, while the parameters are the named, abstract inputs used to define the function.

313 questions
1
vote
1 answer

8086 instruction set: MODR/M byte

The 8086 documentation sites seem a bit vague when the MODR/M byte is mentioned and it's really difficult to comprehend what it is and does. What are all the bits used for in the MODR/M byte and what are the possible options? Some documentation I've…
1
vote
1 answer

How To Count All Operands And Operators in a Java File

I have a java file and i want to count the number of binary,unary,logical operators,and operands in it.I just know i need to use regex for it and i know the basic of it.The task might be simple but what i can't figure out is that there are…
1
vote
1 answer

C++ Help: Error: lvalue required as increment operand

What is wrong here. What does it mean by the error: lvalue required as increment operand? (NOTE: this is a textbook example) #include using namespace std; int main() { int num1 = 0, num2 = 10, result; num1++; …
Cyrus Lee
  • 27
  • 4
1
vote
1 answer

TypeError prevents subtraction

Good afternoon all, I'm new to StackOverflow and Python in general. I'm taking a university course and I'm pretty stumped on pinning down an operand error I'm getting from a very simple calculate-and-return program: currentYear = 2020 age =…
JWU20
  • 13
  • 5
1
vote
3 answers

How to use C.ADDI4SPN and C.ADDI16SP instructions (compressed subset) of RISC-V architecture?

I can't figure out how to call these two instructions in a proper way. The first operand of the first instruction C.ADDI4SPN should be a register, and the second one, if I'm right, should be a number which is scaled by 4. But when I try to call the…
miki1307
  • 147
  • 9
1
vote
1 answer

Unsupported operand type from a function

Write a Python program which accepts the radius of a circle from the user and compute the area. Go to the editor Sample Output : r = 1.1 Area = 3.8013271108436504 My code: def rad_to_area(rad): from math import pi area = pi * (rad**2) …
Deepak47
  • 9
  • 1
  • 3
1
vote
0 answers

Unsupported Operand in Python yet overloaded operator is defined

I'm working on a couple of basic math classes for performing line collisions in 2D. Here is my python code: collisions.py import math class Vector: def __init__(self, x, y): self._x = x self._y = y def…
Francis Cugler
  • 7,788
  • 2
  • 28
  • 59
1
vote
2 answers

What do I have to do with jj in order to fix the operand type error for +: int and tuple?

>>> sum(jj) Traceback (most recent call last): File "", line 1, in sum(jj) TypeError: unsupported operand type(s) for +: 'int' and 'tuple' >>> jj ((2,), (2, 3)) Why does python throw that error? And, how do I fix it?
1
vote
1 answer

Pointers, Invalid Operands to Binary, and Noobs

[Edit: Rectangle definition added at bottom.] [Edit2: XYPoint interface added at bottom.] I'm working on a method that checks if two rectangles overlap. (Yeah, I'm in Kochan's Programming in Objective-C, doing the exercises, and I am painfully new…
ctaggart
  • 166
  • 1
  • 10
1
vote
1 answer

TyperError : unsupported operand type(s) for -: 'float' and 'builtin_function_or_method'

I am trying to implement a Bulirsch-Stoer Algorithm : I've created a function that contains a simplified algorith of it. But first, I've created a midpoint function : basically, the firs application of this midpoint method uses two integration…
Wiss
  • 145
  • 6
1
vote
1 answer

Invalid combination of opcode and operands

SEGMENT .data print db "%d %d %d %d This is a test of printf", 10, 0 rowm dw 160 ;row multiplier iterations db 80 ;number of columns to set SEGMENT .bss offs resd 1 ;offset…
1
vote
1 answer

Unsupported operand type on method

I have a method on a Python class which aims to get an average number: def get_average_rating(self): rated_books = 0 book_sum = 0 for book in self.books: rated_books += 1 book_sum += self.books[book] return…
cgobbet
  • 309
  • 4
  • 12
1
vote
3 answers

Operator '||' cannot be applied to operands of type 'object' and 'bool'

I would like to do a comparison of : ComboBox.SelectedItem which is of the object type to the string.Empty in combination with "||" If I run with above command I get an error: "Operator '||' cannot be applied to operands of type 'object'…
Parnal p
  • 40
  • 6
1
vote
2 answers

C++ invalid operands of types 'double' and 'const char [5]' to binary 'operator+'

I am new to c++ and I have been learning for about 4 weeks, and I now started to try programming my own things, like this thing here I am working on: #include #include using namespace std; class abcformule{ public: …