So, the 'm' or 'M' is another one of those processor directives. This time though, it represents precision roughly double that of a 'double' - which is double that of a 'float'. Personally I've never used values so large, but again, that would be something that would be used in scientific applications - say to represent the number of atoms in a pencil, or the number of stars in the Milky Way galaxy. A number that is just huge.

Another thing I forgot to mention when you are typecasting stuff (putting the f, or d, or m at the end) - it helps when you are doing math with these large numbers. For instance, you might want to add two doubles, and the result would overflow (be too big) a normal double you'd get as the result. In that example you might do something like:

decimal myresult=1.5098298529345f + 4.497587235782f;

(these may not be mathematically or typed correctly, its just for example)

So, you see if the result of adding the two doubles exceeds the storage space provided by a double, you'd need to have the result in a decimal. This is also useful if your adding mixed types like a float and a double. By typecasting the result as a decimal, you ensure that you'll get a correct answer instead of throwing an exception.

]]>yeah page 36 chapter 6 at the top ]]>

Now, why do we put that in code? For one, so the processor will know to handle the higher values as negatives, and secondly, if the value doesn't reach into that negative range, the compiler can make adjustments to optimize memory usage. Same as putting f for float, or d(?) for a double. The compiler will sort things out and use less memory for a float.

As for the 'm' thing, I don't know I haven't seen that, or don't recall when I did. Is that in the book? If so, let me know what page/chapter/etc, and I'll look it up in my copy and see if I can make any sense out of it!

]]>'m' can stand for "mate","mom","maddy", etc right?

]]>1 question.

it says that double has 15 or 16 digits of precision. but i counted the double pi that i posted above and there are more numbers then 15-16. precision it the amount of numbers it can hold after the decimal right?

Int stores a number in the range of –2,147,483,648 to 2,147,483,647 (both negative and positive)

UInt stores a number in the range of 0 to 4,294,967,295 (twice as much as Int, but ONLY positive numbers)

Long and ULong are analogous, they store the same numbers with the same ranges. This is actually new to me. It used to be back when computers didn't have multiple cores and 64 bit processing, Int's stored a smaller range of values (based on the processor architecture and the fact that you could only squeeze so many numbers into a single register). Now days, with 32 and 64 bit being the norm, those same registers can hold much more data, therefore, Ints use the same space as Longs since the standard the processor deals with now is larger. If that makes any sense. Think of it this way: Int's used to be smaller, but now are as large as a long. To make backward compatibility work for applications that still use Int's, they are still supported, but offer the same functionality as a Long.

Floats are the ONLY type which supports fractional numbers. (ie: 1.5, 2.765, 3.1415397)

Doubles are similar to floats, but provide more fractional precision. (ie: 1.8745872785544235, 2.345626256234523, 3.452346262365)

Floats and Doubles are used when high precision is needed, most often in scientific settings. Floats are also used in game framework like XNA, OpenGL, and Monogame because they provide a seperation between screen space and world space with extremely high precision. Hope that helps, and for a full list of variable types, see:

]]>like

double pi = 3.14159265358979323846;

float anotherPi = 3.1415926f;

dont understand whats the point of adding an "f"…

i even read about it dont understand.

then u have.

long aBignumber = 39358593258529L;

ulong bigOne = 2985825802805280508UL;

u say that sticking a 'u' or 'U' on the end ofan integer litaral to show that it is supposed to be an unsigned integer literal.

the 'L' and 'UL' is just for you to understand?

the computer doesnt care about the 'L' and 'UL' just something you reference with right?

so to summarize.. do i really need float and double…?

because there pretty much just like long.. just wayy bigger im pretty sure. and i don't think anyone will ever have a number that is needed for float and double.. lol.

but im a little confused.

double usses 8 bytes.

float usses 4 bytes.

int usses 4 bytes

long usses 8 bytes..

why not just use int and long, seems like all 4 do the same thing. Im just unsure of what the letters do?

can i add the letters to the int and long O.o..