The `ceilToDouble` method returns the least integer double value no smaller than the given double.
The syntax of double.ceilToDouble() method is:
double ceilToDouble()
This ceilToDouble() method of double returns the least integer double value no smaller than this
.
double.ceilToDouble() returns value of type double
.
In this example,
num
with a value of 3.14
.ceilToDouble()
method on num
to find its ceiling value.void main() {
double num = 3.14;
double ceilValue = num.ceilToDouble();
print('Ceiling value of 3.14: $ceilValue');
}
Ceiling value of 3.14: 4
In this example,
num
with a value of -5.6
.ceilToDouble()
method on num
to find its ceiling value.void main() {
double num = -5.6;
double ceilValue = num.ceilToDouble();
print('Ceiling value of -5.6: $ceilValue');
}
Ceiling value of -5.6: -5
In this example,
num
with a value of 10.0
.ceilToDouble()
method on num
to find its ceiling value.void main() {
double num = 10.0;
double ceilValue = num.ceilToDouble();
print('Ceiling value of 10.0: $ceilValue');
}
Ceiling value of 10.0: 10
In this Dart tutorial, we learned about ceilToDouble() method of double: the syntax and few working examples with output and detailed explanation for each example.