SLR 13 Flashcards
Data Types (38 cards)
What are different data types used for?
Different data types takes up different amounts of memory,, so the correct data types must be used to optimise program performance
What is an integer?
A whole number
What is a Real/Float?
Any non-integer number
What is a Boolean?
True or False
What is a character?
Represents any alphanumerical symbols
What is a string?
Represents a collection of characters
What is a primitive data type?
Any basic data type provided by a language as a foundational building block
What does casting mean?
Changing a data type into another
How is data represented in RAM
Through 0s and 1s
How is data stored in a hard disk?
Through magnetism. 1 represents South and 0 represents North
How is data stored in optical media?
On a disk which is read using a laser
How is data stored in an SSD?
Uses electricity and electrons. 0s and 1s represent if electrons are trapped or not
What is Base 2?
Binary
What is base 10?
Denary
What is base 16?
Hexadecimal
What do positive numbers start with in sign and magnitude?
0
What do negative numbers start with in sign and magnitude?
1
How does Sign and Magnitude work?
The last number in a binary sequence (usually 128) is replaced by a -/+ to make a number a positive or a negative
How does Hexadecimal work?
10 = A
11 = B
12 = C
etc….
What is hex used for in CS?
To turn larger digits into smaller and simpler ones to save space and to make the numbers MUCH easier to read
What is floating binary point?
Storing numbers using a fractional component such as 6.5 to extend the number line from left to right
How can floating binary point numbers be made more accurate?
Moving the binary point up and down the number line
What are the benefits of floating binary points?
With less fractions larger numbers can be stored but at the cost of reduced accuracy
With more fractions numbers can be stored with more precision with a reduced size
What is the Mantissa?
The number itself