Cheatography
https://cheatography.com
Sample cheatsheet for the D Programming Language
This is a draft cheat sheet. It is a work in progress and is not finished yet.
Main function
int main(string []args){
// return isn't necessary
}
|
Default type properties
.init |
Default type initializer |
.sizeof |
size in bytes |
.alignof |
alignment size |
.mangleof |
string representating of "mangled" representation of type |
.stringof |
string representing of source representation of type |
Symbolic data types
Type |
Size |
Description |
char |
1 byte |
UTF-8 char |
wchar |
2 bytes |
UTF-16 char |
dchar |
4 byte |
UTF-32 char |
Integer data types
Type |
Size |
Description |
bool |
1 byte |
True or False |
byte |
1byte |
-128 to 127 |
ubyte |
1byte |
0 to 255 |
short |
2 bytes |
-32,768 to 32,767 |
ushort |
2 bytes |
0 to 65,535 |
int |
4 bytes |
-2,147,483,648 to 2,147,483,647 |
uint |
4 bytes |
0 to 4,294,967,295 |
long |
8 bytes |
-9223372036854775808 to 9223372036854775807 |
ulong |
8 bytes |
0 to 18446744073709551615 |
Integral type properties
.min |
Minimum value of type |
.max |
Maximum value of type |
|
|
Float data types
Type |
Size |
Description |
float |
4 bytes |
1.17549e-38 to 3.40282e+38 |
ifloat |
4 bytes |
1.17549e-38i to 3.40282e+38i |
double |
8 bytes |
2.22507e-308 to 1.79769e+308 |
idouble |
8 bytes |
2.22507e-308i to 1.79769e+308i |
real |
10 bytes |
3.3621e-4932 to 1.18973e+4932 |
ireal |
10 bytes |
3.3621e-4932i to 1.18973e+4932i |
cfloat |
8 bytes |
1.17549e-38+1.17549e-38i to 3.40282e+38+3.40282e+38i |
cdouble |
16 bytes |
2.22507e-308+2.22507e-308i to 1.79769e+308+1.79769e+308i |
creal |
20 bytes |
3.3621e-4932+3.3621e-4932i to 1.18973e+4932+1.18973e+4932i |
Float type properties
.nan |
Not A Number value |
.infinity |
Infinity value |
.dig |
Number of decimal digits in precision |
.min |
Minimum value of type |
.max |
Maximum value of type |
.re |
Real part of type |
.im |
Imagine part of type |
.epsilon |
smallest increment to value 1 |
|