Tool/software: Code Composer Studio
I am trying to round a number in CCS using the C "round" function. This should round a number to the closest whole number. For example, I want round(27.7) to equal 28. However, I realized that "round" in my code is not rounding to the nearest whole number.
How do I fix this?
Attached is a snippet of my code. This is the code I want to round. The capitalized words are macros.
uint16_t highValues = round(DATAFREQ * ARRAYSIZE / (2 * PULSESNUMBER * analyzingFreq));