What do numbers using 0x notation mean?

Literals that start with 0x are hexadecimal integers. (base 16) The number 0x6400 is 25600. For an example including letters (also used in hexadecimal notation where A = 10, B = 11 … F = 15) The number 0x6BF0 is 27632.

What are the distinctions between the various symbols (*,&, etc) combined with parameters?

To understand this you’ll first need to understand pointers and references. I’ll simply explain the type declaration syntax you’re asking about assuming you already know what pointers and references are. In C, it is said that ‘declaration follows use.’ That means the syntax for declaring a variable mimics using the variable: generally in a declaration … Read more

What does %w(array) mean?

%w(foo bar) is a shortcut for [“foo”, “bar”]. Meaning it’s a notation to write an array of strings separated by spaces instead of commas and without quotes around them. You can find a list of ways of writing literals in zenspider’s quickref.

1e-9 or -1e9, which one is correct?

Neither is more correct than the other. They just represent different values. 1e-9 is 0.000000001; the minus sign applies to the exponent. -1e9 is -1000000000.0; the minus sign applies to the number itself. The e (or E) means “times 10-to-the”, so 1e9 is “one times ten to the ninth power”, and 1e-9 means “one times ten to the negative ninth power”. In mathematical scientific notation, this … Read more