Trusted answers to developer questions

Harris Amjad

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

The ** ceil() function** in Dart returns the nearest smallest integer value greater than or equal to a number.

The figure below shows the mathematical representation of the `ceil()`

function.

```
number.ceil()
```

This function does not require a parameter.

`ceil()`

returns the nearest, smallest integer value greater than or equal to a number.

The code below shows the use of the `ceil()`

function in Dart.

import 'dart:convert';void main() {//positive numberprint("The value of (1.5).ceil(): ${(1.5).ceil()} ");// negative numberprint("The value of (-5.5).ceil(): ${(-5.5).ceil()} ");//zeroprint("The value of (0).ceil(): ${(0).ceil()}");}

- Line 5: We calculate the ceiling value of the positive number
`1.5`

using`ceil()`

.

- Line 8: We calculate the ceiling value of the negative number
`-5.5`

using`ceil()`

.

- Line 11: We calculate the ceiling value
`0`

using`ceil()`

.

RELATED TAGS

dart

ceil

math

communitycreator

CONTRIBUTOR

Harris Amjad

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring

Related Courses