1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-10-03 17:51:51 +02:00

Merge pull request #1608 from venegu/master

[javascript/en] Adding modulo division
This commit is contained in:
Adam Bard
2015-10-18 11:54:59 +08:00

View File

@@ -54,6 +54,11 @@ doStuff()
// Including uneven division. // Including uneven division.
5 / 2; // = 2.5 5 / 2; // = 2.5
// And modulo division.
10 % 2; // = 0
30 % 4; // = 2
18.5 % 7; // = 4.5
// Bitwise operations also work; when you perform a bitwise operation your float // Bitwise operations also work; when you perform a bitwise operation your float
// is converted to a signed int *up to* 32 bits. // is converted to a signed int *up to* 32 bits.
1 << 2; // = 4 1 << 2; // = 4