Stuck with an error on HeartBeast’s RPG tutorial. Can’t figure out why. Invalid operands β€˜Vector2’ and β€˜int’ in operator β€˜==β€˜
πŸ‘︎ 14
πŸ’¬︎
πŸ“…︎ Dec 16 2021
🚨︎ report
Since Go is a type-safe language, its numerical operations generally require their operands to be of the same type. [time.Duration * time.Duration is valid, time.Duration * Int isn't] news.ycombinator.com/item…
πŸ‘︎ 168
πŸ’¬︎
πŸ‘€︎ u/cmov
πŸ“…︎ Oct 18 2021
🚨︎ report
Invalid operands 'float' and 'Vector2' in operator '!='.

How do I fix this I dont seem to find anything wrong?

this is the code

https://preview.redd.it/76inlvppte681.png?width=835&format=png&auto=webp&s=be909b275d65a27d8d8dd03a980e51386e5b5c9d

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/potatogreekgod
πŸ“…︎ Dec 19 2021
🚨︎ report
Missing Operand

I am trying to make a calculator so I obviously need calculations, I made variables for numbers to replace using set /p %addnum1% as my first variable and set /p %addnum2% as my second variable, I use set /a addans=%addnum1%+%addnum2% as my equation but when I load it is says "Missing Operand". What am I doing wrong?

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/Firm-Fruit-351
πŸ“…︎ Jan 08 2022
🚨︎ report
Is an argument in a function just the operand and then a function is the combination of operation and operand to produce an output?
πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/Icy_Pressure_9690
πŸ“…︎ Dec 13 2021
🚨︎ report
I keep on getting the "Invalid operands 'bool' and 'int' in operator '*'" and I do not know why as I have used this combination before without issues. Any help? reddit.com/gallery/pir6rp
πŸ‘︎ 8
πŸ’¬︎
πŸ‘€︎ u/X-Leao-X
πŸ“…︎ Sep 06 2021
🚨︎ report
Error: Operands to the logical and (&&) and or (||) operators must be convertible to logical scalar values.

My code:

if (cond== 'RGS') || (cond== 'Veh')
    disp('Analysing...')
else 
    disp('Please type RGS or Veh if you want to continue the analysis!') 
end

ERROR:Operands to the logical and (&&) and or (||) operators must be convertible to logical scalar values.

How am I supposed to write 'OR', 'AND' etc. in if statements?

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/myillusion13
πŸ“…︎ Dec 03 2021
🚨︎ report
Invalid operands 'Vector3' and 'float' in operator '<' with AStar

Hi, I was trying to make a procedural generation algorithm for my Rogue-like game challenge when I got this error:

func find_mst(nodes):
	var path = AStar.new()
	path.add_point(path.get_available_point_id(), nodes.pop_front())
	while nodes:
		var min_dist = INF
		var min_p = null
		var p = null
		for p1 in path.get_points():
			p1 = path.get_point_position(p1)
			for p2 in nodes:
# ERROR: Invalid operands 'Vector3' and 'float' in operator '&lt;'
				if p1.direction_to(p2) &lt; min_dist:
					min_dist = p1.direction_to(p2)
					min_p = p2
					p = p1
		var n = path.get_available_point_id()
		path.add_point(n, min_p)
		path.connect_points(path.get_closest_point(p), n)
		nodes.erase(min_p)
	return path

I was using this tutorial, I know that its pretty outdated, but it really does explain well, thanks in advance

πŸ‘︎ 3
πŸ’¬︎
πŸ“…︎ Dec 10 2021
🚨︎ report
Missing Operand. Is this of any interest to fix?
πŸ‘︎ 14
πŸ’¬︎
πŸ‘€︎ u/DrQuack32
πŸ“…︎ Nov 23 2021
🚨︎ report
Why does lisp allow AND/OR operators to have 0 or 1 operands?

Someone I know is writing some custom AND/OR functions in a DSL, and they only allow 2 or more operands. I'm trying to convince them that 0 or 1 operands is also valid.

Can someone help me justify that?

πŸ‘︎ 19
πŸ’¬︎
πŸ‘€︎ u/fooob
πŸ“…︎ Aug 13 2021
🚨︎ report
No operator matches these operands VS2019 C++20. Even though I have the operators and they work on lines immediately above

First off, for some context:

I've been doing a lot of C# .NET the last several years and haven't really touched C++ since college, and I've been working through the Ray Tracer Challenge book in my spare time. Got to a part where I needed the PI constant. A quick Google search told me that in C++20 you can include <numbers> and PI is found in std::numbers::pi. Also found out that my project settings were set to C++14 instead of C++20. No problem, I changed it to C++20. I fixed a few warnings that popped up, no big deal. However, since making the switch to C++20 my Point * Matrix and Vector * Matrix operator overloads are not working and I'm seeing weird behavior. See below:

TEST_F(MatrixTest, MatrixScaling)
{
	Matrix scaling = Matrix::Scale(2, 3, 4);

	Point scaledPoint = p2 * scaling;
	Vector scaledVector1 = v4 * scaling;
	Matrix inversedScaleMatrix = scaling.Inverse();
	Vector inversedScale = v4 * inversedScaleMatrix;

	inversedScale = v4 * scaling.Inverse();
	Point reflectedPointXAxis = Point(2, 3, 4) * Matrix::Scale(-1, 1,1);
}

On line 1 I am instantiating a scaling matrix which is a static method that returns a Matrix object. The following 4 lines are valid operations.

Lines 8 and 9 both throw "No operator matches these operands" error with the red squiggly under the *. Even though the operation immediately above it on lines 5 and 6 do the same thing, just in a more roundabout manner.

Why does using the result of the instance method directly not work when calling the same instance method and assigning it to an intermediate instance does work?

I have also found that removing the & symbol from the operator overload in Point.h gets rid of this error, but I'd rather not be passing matrices around by value millions of times a second. All of this functionality did not throw an error in C++14 btw. I'll also include the relevant bits of Point.h, Vector.h, and Matrix.h:

class Matrix {
private:
	std::size_t size;
	float* matrix;
	const static bool FloatCompare(const float f1, const float f2);

public:
	\* Other member methods \*
	static Matrix Identity();
	Matrix Inverse();
	static Matrix Translate(const float x, const float y, const float z);
	static Matrix Scale(const float x, const float y, const float z);

	// Operator overloads.
	Matrix&amp; operator=(Matrix other);
	bool operator==(const Matrix&amp; other);
	Matrix operato
... keep reading on reddit ➑

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/GameDotPlay
πŸ“…︎ Oct 24 2021
🚨︎ report
Are operands still evaluated, even if they're pointless ?

Take the example if(a && b). Here, if a evaluates to false, b isn't considered, as it's useless to do so. You can use this trick to shorten checking for NULL, like writing if(ptr && *ptr == whatever) : if ptr == NULL, right-hand side of the operation isn't evaluated, and NULL isn't dereferenced. That's well and good.

What I'm wondering about is, does that trick work with other operations ? Say, 0 * b. As this will always equate 0, is b evaluated ? I'd like to know, as this could allow me to write something like int a = (ptr != NULL) * (*ptr). Here, if ptr is indeed NULL, the whole thing evaluates to zero, and NULL isn't dereferenced, as I'd like to.

πŸ‘︎ 26
πŸ’¬︎
πŸ‘€︎ u/KrozmaSan
πŸ“…︎ Aug 14 2021
🚨︎ report
AND's order of operands

Question: Are logical operands processed left-to-right or right-to-left?

Details: Let's say my code includes this line

if A = 1 AND B = 2 then

AND is an operator. "A = 1" and "B = 2" are its operands.

Which operand is evaluated first, "A = 1" or "B = 2"?

More Detailed Details*:*

The AND operator has two operands.

  1. A=1
  2. B=2

Both of those operands must evaluate to TRUE for the THEN clause to be executed.

If we evaluate A, the left operand, and it's not equal to 1 then we already know the IF clause doesn't pass, and (I assume) VBA will not bother testing B, the right operand. Therefore it would make sense to put the operand which is more likely to fail on the left. That will save on execution time.

However I don't know for sure that the operands of the AND operator are evaluated left-to-right. I'm pretty sure C++ does it right-to-left, for example.

In what order are the two operands of the AND operator evaluated in VBA? Left to right or right to left?

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/Musicianalyst
πŸ“…︎ Sep 24 2021
🚨︎ report
I have a hard time to figure out why it gives me "TypeError: unsupported operand type(s) for -: 'int' and 'str'"
πŸ‘︎ 5
πŸ’¬︎
πŸ‘€︎ u/WorthNorth3508
πŸ“…︎ Oct 05 2021
🚨︎ report
no operator "==" matches these operands

Trying to finish a homework assignment and I am stumped because I can't figure out lines 101-115. More specifically how to make the if-else and for-while functions work. I have tried a few different "i = " definitions (I don't know what it's called) and I've tried changing the operator and this is what I'm stuck on now. Updated Code as of 9/14/2021 (7:28pm EST):

#include &lt;iostream&gt;
#include &lt;string&gt;


using namespace std;

class dayType
	{
	public:
		static string weekDays[7];

		dayType();
		dayType(string);

		void print(); //print
		void addDay(int nDays); //adding days

		void setDay(string); //set day
		void getDay(string);

		string getPrevDay(); //retrieve a day
		string getNextDay(); //retrieve a day

	private:
		int i;
	};
#pragma once
int main()
{
	int i;
	string d;
	cout &lt;&lt; "Enter the day :";
	getline(cin, d);
	dayType Da(d);
	Da.setDay(d);
	Da.setDay(d);

	cout &lt;&lt; "Enter the number of days to add :";
	while (!(cin &gt;&gt; i) || i &lt; 0) {
		cin.clear();
		cin.ignore(999, '\n');
		cout &lt;&lt; "Invalid data type! \nPlease enter number of days to add :";
	}

	Da.setDay(d);
	Da.print();
	system("pause");
	return 0;

	
}


void dayType::setDay(string d)
{
	weekDays[0] = "Mon";
	weekDays[1] = "Tues";
	weekDays[2] = "Wednes";
	weekDays[3] = "Thurs";
	weekDays[4] = "Fri";
	weekDays[5] = "Satur";
	weekDays[6] = "Sun";

	return setDay(d);
}

	void dayType::setDay(string d) {
		i = 7;
		for (int n = 0; n &lt; 7; n++) {
			if (d == weekDays[n]) {
				i = n;
			}
		}
	}



	 void dayType::getDay(string d)
	 {
		 if (getDay(d) == weekDays)
		 {
			 i = 0;
			 return weekDays[i];
		 }
		 else if (getDay == weekDays[1])
		 {
			 i = 1;
			 return "Tuesday";
		 }
		 else if (getDay == weekDays[2])
		 {
			 i = 2;
			 return "Wednesday";
		 }
		 else if (getDay == weekDays[3])
		 {
			 i = 3;
			 return "Thursday";
		 }
		 else if (getDay == weekDays[4])
		 {
			 i = 4;
			 return "Monday";
		 }
		 else if (getDay == weekDays[5])
		 {
			 i = 5;
			 return "Friday";
		 }
		 else if (getDay == weekDays[
... keep reading on reddit ➑

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/NewInvestorBoy
πŸ“…︎ Sep 14 2021
🚨︎ report
for some reason its giving me this error that says "Invalid operands 'float' and 'Vector2' in operator '-'."
πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/DiamondWarrior06
πŸ“…︎ Oct 01 2021
🚨︎ report
Someone got the operand on him (badumtss)
πŸ‘︎ 81
πŸ’¬︎
πŸ‘€︎ u/TheSonicPro
πŸ“…︎ Aug 27 2021
🚨︎ report
syntax error operand expected (error token is )

I'm trying to run this command but I'm getting the entitled error.

$(sshpass -p ${PASSWORD} scp -P 2223 ${FILE_ZIP} pi@${DEVICES_IP[$1]}:~);

>update.sh: line 32: p@sswd: syntax error: operand expected ( error token is "p@sswd")

Any ideas on how to pass the password string?

πŸ‘︎ 7
πŸ’¬︎
πŸ‘€︎ u/netpumber
πŸ“…︎ Aug 13 2021
🚨︎ report
can someone help me with the health bar signal, godot keeps saying: Invalid operands 'String' and 'bool' in operator '=='. can some one help please
πŸ‘︎ 17
πŸ’¬︎
πŸ‘€︎ u/wulf_001
πŸ“…︎ Jul 15 2021
🚨︎ report
Vsynth modules and using the ">" math operand to get some nice results. Add some feedback and hue modulation and it turned out pretty exciting for me! youtu.be/wfa2xepbwsE
πŸ‘︎ 14
πŸ’¬︎
πŸ‘€︎ u/gentlereturn
πŸ“…︎ Aug 06 2021
🚨︎ report
This teaser says: - OPERAND - INPUT - OUTPUT @HYPEX
πŸ‘︎ 6
πŸ’¬︎
πŸ‘€︎ u/Niburu_Exus_4311
πŸ“…︎ Jun 07 2021
🚨︎ report

Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.