This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Algorithm clarification

I am writing code to calculate the baud rate registers for UART1. There is a flow chart on page 336 of the manual that I am using as a guide. There is a block that says:

int(PCLK / (16 * BR * FREST)

What do they mean by int? Does that mean convert the floating point result to an integer by casting? Please clarify.

I know the table part means find the closest value to the calculated decimal result in the lookup table. I am representing those values as constant ints and doubles.

Parents
  • "page 336 of the manual"

    What manual? And what version/issue/release of that manual?

    "What do they mean by int?"

    Who is "they"? Why don't you ask "them"?

    Since the expression is a division, its result is likely to have a fractional part.

    Putting int(...) like that is a pretty conventional way to say, "the integer part of ..."

Reply
  • "page 336 of the manual"

    What manual? And what version/issue/release of that manual?

    "What do they mean by int?"

    Who is "they"? Why don't you ask "them"?

    Since the expression is a division, its result is likely to have a fractional part.

    Putting int(...) like that is a pretty conventional way to say, "the integer part of ..."

Children
No data