matsis
11-16-2005, 04:15 AM
Am working on improving my automatic proportional toebrake gauge and would like to give it a more progressive reaction by using the ^ Operator (power) in the following manner:
trigger_key_event(KEY_AXIS_LEFT_BRAKE_SET,16384 - 32768*(1-(rudder_pos.var_value.n+0.03)/-0.45)^3 );
However I get the following error report:
C2296: '^' : Ungültig, da der linke Operand vom Typ 'double ' ist
C2296: '^' : Invalid, as the left Operand is of Type 'double '
The left operand here is this expression:
(1-(rudder_pos.var_value.n+0.03)/-0.45)
wherein
MODULE_VAR rudder_pos= {RUDDER_DEFLECTION};//Rudder Position radians
is a FLOAT64
If I read the definition of the ^ operator correctly it states that
"Syntax
Result = Number^Exponent
...
Number: An arbitrary numerical Value.
..."
The explanation of numerical value:
"Ein beliebiger Ausdruck, der als Zahl ausgewertet werden kann. Elemente eines Ausdrucks können beliebige Kombinationen von Schlüsselwörtern, Variablen, Konstanten und Operatoren enthalten, die als Ergebnis eine Zahl liefern."
"An arbitrary Value that can be analized as a number. Elements of a value can contain arbitrary combinations of keywords, variables, constants and operators, the result of which must be a number."
No talk at all of double types (numbers) not being allowed ???
Any insights from seasoned C++ programmers?
trigger_key_event(KEY_AXIS_LEFT_BRAKE_SET,16384 - 32768*(1-(rudder_pos.var_value.n+0.03)/-0.45)^3 );
However I get the following error report:
C2296: '^' : Ungültig, da der linke Operand vom Typ 'double ' ist
C2296: '^' : Invalid, as the left Operand is of Type 'double '
The left operand here is this expression:
(1-(rudder_pos.var_value.n+0.03)/-0.45)
wherein
MODULE_VAR rudder_pos= {RUDDER_DEFLECTION};//Rudder Position radians
is a FLOAT64
If I read the definition of the ^ operator correctly it states that
"Syntax
Result = Number^Exponent
...
Number: An arbitrary numerical Value.
..."
The explanation of numerical value:
"Ein beliebiger Ausdruck, der als Zahl ausgewertet werden kann. Elemente eines Ausdrucks können beliebige Kombinationen von Schlüsselwörtern, Variablen, Konstanten und Operatoren enthalten, die als Ergebnis eine Zahl liefern."
"An arbitrary Value that can be analized as a number. Elements of a value can contain arbitrary combinations of keywords, variables, constants and operators, the result of which must be a number."
No talk at all of double types (numbers) not being allowed ???
Any insights from seasoned C++ programmers?