Changeset 8180d8 for src/base/helper.hpp


Ignore:
Timestamp:
Apr 5, 2013, 12:39:30 PM (13 years ago)
Author:
Julian Iseringhausen <julian.iseringhausen@…>
Children:
4a709e
Parents:
f57182
Message:

Merge stashed open boundary stuff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/base/helper.hpp

    rf57182 r8180d8  
    3030
    3131#include <cassert>
     32#include <cmath>
    3233#include <cstdio>
    3334#include <limits>
     
    161162  }
    162163
     164  inline int RoundUpToNextMultiple(int number, int multiple)
     165  {
     166    return static_cast<int>(ceil((static_cast<vmg_float>(number)-0.5) / multiple)) * multiple;
     167  }
     168
     169  inline int RoundDownToNextMultiple(int number, int multiple)
     170  {
     171    return static_cast<int>(floor((static_cast<vmg_float>(number)+0.5) / multiple)) * multiple;
     172  }
     173
    163174
    164175  /**
Note: See TracChangeset for help on using the changeset viewer.