What is a double in Dart?

In the Dart programming language, double is a data type that stores decimal numbers (fractional numbers). For each double variable, eight bytes are allocated in the memory.

If you try to assign any integer value to the double variable then, by default, it will be cast to the double data type. For example, 66 would be represented as 6.06.0.

svg viewer

Code

import 'dart:convert';
void main() {
//Fractional value
double num1 = 6.532;
// Integer Value
double num2 = 6;// cast this integer to double
// printing both numbers
print(num1);
print(num2);
}

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved