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
doublevariable then, by default, it will be cast to thedoubledata type. For example, would be represented as .
Code
import 'dart:convert';void main() {//Fractional valuedouble num1 = 6.532;// Integer Valuedouble num2 = 6;// cast this integer to double// printing both numbersprint(num1);print(num2);}
Free Resources
Copyright ©2025 Educative, Inc. All rights reserved