mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
Adding modulo division to JavaScript article
This commit is contained in:
parent
324c707c08
commit
53366ebdbe
@ -54,6 +54,11 @@ doStuff()
|
||||
// Including uneven division.
|
||||
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
|
||||
// is converted to a signed int *up to* 32 bits.
|
||||
1 << 2; // = 4
|
||||
|
Loading…
Reference in New Issue
Block a user