• rounding a float to an integer
    Hi all, I like to round a float to the nearest integer value and assign the value to an integer. How do I do that in C code? In know it is something with "round" but I can not find the proper syntacs...
  • Rounding floats to integers on Cortex-M4
    I've encountered an odd problem on STM 32F4xx CPU with hardware FPU enabled: When rounding floats to integers, compiler always uses VCVT (round towards zero) instruction instead of VCVTR (round using...
  • Cortex M4 Float to int: Round to Nearest / VCVTR?
    Is there any way to convince the compiler to use the VCVTR command to convert floats to ints? That would be extremely nice. Currently the compiler seems to use always the VCVT, but this rounds...
  • round result of floating point calcualtion
    Hello, I have a problem with the accuracy of the result when I divide 2 float values. This is the line in my source Code: dds_word.long_dds = 2.147483648E16 / 7.1312E7 The result which I...
  • Integer to Floating conversion error
    I get strange behaviour with integer conversion; in the following example T4Frozen never reaches the value 790 because it turn back to 700 when it step over 767. This happen both on the target and on...