what is the difference between data types single and double in simulink ?
214 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Gokul Prassad
am 8 Mai 2019
Kommentiert: Gokul Prassad
am 8 Mai 2019
I tried to change the data type uint16 to double and i was getting an output of 10 digit number for inputs of a constant decimal number and 1 digit number.
But when I tried the same with data type single, I got the right anwer (with decimal points).
Kindly explain.
2 Kommentare
Akzeptierte Antwort
Raj
am 8 Mai 2019
Bearbeitet: Raj
am 8 Mai 2019
Your floating point data (Decimal Data) can be represented either via Single data type of Double data type. The basic difference being the precision between the two types. Now contary to the name, its not the precision that doubles. Its the number of Bits used in your computer memory for storing the data that doubles. Single datatype uses 32 bits of memory whereas Double uses 64 bits of memory. With higher precision, you get better accuracy but at the cost of memory and processing. This being a nutshell summary, you can google out for details. Hope this helps!
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!