floor

Round down to nearest integer

Int floor(Float)

Rounds a floating point number down to the next lower integer.

Parameters:

  1. Float: the number to round.

Returns: An integer.

Example: test_floor.wdl

version 1.3

workflow test_floor {
  input {
    Int i1
  }

  Int i2 = i1 - 1
  Float f1 = i1
  Float f2 = i1 - 0.1

  output {
    Array[Boolean] all_true = [floor(f1) == i1, floor(f2) == i2]
  }
}

Example input:

{
  "test_floor.i1": 2
}

Example output:

{
  "test_floor.all_true": [true, true]
}