Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Ceiling function for sup round

Thom
2017-02-02
2023-08-17
  • Thom - 2017-02-02

    Hi everybody,

    I'm loocking for something to get the superior round of a division.

    Ex:
    result : INT;

    result := Ceil(3/2);
    // result = 2


    After some search on big brother, I don't find Ceil or equivalent function.

    Any idea?

     
  • josepmariarams - 2017-02-03

    Hi

    An possible solution

    Res=a/b+ ((a mod b) * 2)/b

     
  • Thom - 2017-02-03

    Yes, I try and it work!

    Thx a lot! => Topic closed

     

Log in to post a comment.