This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TM4C123GH6PM: Is a float not allowed to be evaluated using a variable within its expression. "expression must have a constant value"

Part Number: TM4C123GH6PM


Tool/software: Code Composer Studio

Hi

I am doing float point calculation but I am getting an error when I compile the code.

float PI = 3.14159265358979323846f;

float GyroMeasError = PI * (60.0f / 180.0f); 

float beta = sqrt(3.0f / 4.0f) * GyroMeasError; 

The error occurs for the lines where the GyroMeasError and the beta are calculated.

error #28: expression must have a constant value

error #60: function call is not allowed in a constant expression

Thanks,

Fil