User Tools

Site Tools


ch04-getting-stuff-done-i

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
ch04-getting-stuff-done-i [2017/08/30 23:04]
mithat [Arithmetic operators]
ch04-getting-stuff-done-i [2017/08/30 23:09]
mithat [Arithmetic operators]
Line 129: Line 129:
 === Modulus === === Modulus ===
  
-The ''​%''​ operator is used for the modulus operator. Despite appearances,​ the modulus operator has nothing to do with percentages. The modulus operator operates on two operands that must be (or evaluate to) integer values. The modulus ​operation produces the //​remainder//​ that results from the division of the two operands+The ''​%%%%%''​ operator is used for the modulus operator. The modulus operator operates on two operands that must be (or evaluate to) integer ​(not just numeric) ​values.  Despite appearances,​ this operation has nothing to do with percentages. The operation produces the //​remainder//​ that results from the division of the two operands.
  
 <​code>​ <​code>​
Line 139: Line 139:
 </​code>​ </​code>​
  
-The result of the above is that ''​%%z''​%% holds the value 2.((To be pedantic, there is a difference between modulus and remainder, but it only applies to negative numbers. FIXME))+The result of the above is that ''​%%z%%'' ​holds the value 2. ((To be pedantic, there is a difference between modulus and remainder, but it only applies to negative numbers. FIXME))
  
 === Assignment === === Assignment ===
ch04-getting-stuff-done-i.txt · Last modified: 2017/09/27 23:26 by mithat