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);
}
New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
🏆 Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved