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 thedouble
data type. For example, would be represented as .
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