The Precision Cutter

Easy+15 XP

Mission Briefing

The lumberjack robots are cutting too much wood! We need them to round down their measurements to the nearest whole log to avoid wasting resources.

The Concept: Floor Rounding

JavaScript has a built-in mathematical toolbox called the Math object. Math.floor(x) is a method that takes a decimal and forcefully rounds it down to the nearest whole integer.

The Objective

Your function receives a fractional number decimal.

  1. Use Math.floor() to round the number down.
  2. Return the resulting integer.

01EXAMPLE 1

Inputdecimal = 4.9
Output4

Constraints

  • Use Math.floor().
FundamentalsMath
JavaScript
Loading...
3 Hidden

Input Arguments

decimal4.9

Expected Output

4

Click RUN to test your solution