File: roundup.d

package info (click to toggle)
sambamba 1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,528 kB
  • sloc: sh: 220; python: 166; ruby: 147; makefile: 103
file content (13 lines) | stat: -rw-r--r-- 231 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
module bio.std.sff.utils.roundup;

import std.traits;
import std.conv;

/// First number
T roundup(T)(T number) 
    if (isUnsigned!T)
{
    if (number % 8 == 0)
        return number;
    return to!T(number + (8 - number % 8));
}