1/29
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Value
cannot be simplified further and belongs exclusively to some type
(8 // this is the number 8
"Hello" // this is the string "Hello"
True // this is the Boolean value True)
Types
a defining shape of data, describes a set of valid values which follow a set of restrictions
(Boolean, Int, Char,
String)
Operators
describe computations which can be performed on a set number of values of a given type
(+, -, /, \*,%, &&, ||, ==, <=, >=, !=, !, +)
Expression
a set of values and operators which evaluate to become a single value
(11+ (33/3))
Boolean
represents the logical value true or false
Boolean Operators
NOT (!), AND(&&), OR(||)
(!true, true && true, false || !false && true || false)
Int (integer)
a whole number, who's value is between -2,147,483,648 and 2,147,483,647
uint (unsigned int)
a positive whole number which is a value between 0 and 4,294,967,295.
Addition
Add: (int,int)→int returns the sum of two integers.
Overflow
If the sum exceeds int.MaxValue, int wraps around to int.MinValue
Subtraction
(int,int)→int returns the difference between two integers
Underflow
If the difference is less than int.MinValue, int wraps around to int.MaxValue.
Multiplication
(int,int)→int returns the product of two integers.
Integer Division
(int,int)→int returns the quotient of two integers, discarding any remainder.
Division by Zero
results in a DivideByZeroException
Truncation
The fractional part of the division is discarded.
Modulo
(int,int)→int returns the remainder of a division between two integers.
Remainder
The result is always an integer between 0 (inclusive) and the absolute value of the divisor (exclusive).
Floating-Point Representation
defines a valid range for its whole value, along with a precision which determines what fractionals are possible.
double
a 64-bit floating-point number used to approximate real numbers (range of approximately ±1.7976931348623157E+308 and a precision of 15-16 decimal digits)
float
a 32-bit floating-point number used to approximate real numbers (a range of approximately ±3.4028235E+38 and a precision of 7 decimal digits)
decimal
a 128-bit floating-point number designed for precise representation of decimal fractions (range of approximately ±7.9228162514264337593543950335 and a precision of 28-29 decimal digits)
Comparison
an operation that takes two values and produces a boolean by checking their relationship.
Char
a 16-bit value type representing a single text character with a value between 0 and 65,535.
Character Addition
(char,int)→int returns the numeric result of adding a character's code and an integer
Strings
an indexed immutable collection of characters.
Concatenation
(string,string)→string returns a new string containing all characters from both inputs in order
ToUpper
string→string returns a new string with all characters converted to uppercase
ToLower
string→string returns a new string with all characters converted to lowercase
Length
string→int returns the number of characters in the string