Add mod (and setmod) operators
This commit is contained in:
1 parent
dc2fe63e42
commit
3403d07912
4 files changed
+38
-4
No files matched your search
+14
-1
@@ -289,6 +289,14 @@ null
|
||||
null
|
||||
[2, 8, 10, 14]
|
||||
|
||||
25 % 7
|
||||
null
|
||||
4
|
||||
|
||||
49732 % 472
|
||||
null
|
||||
172
|
||||
|
||||
1 + tonumber + ("10" | tonumber)
|
||||
4
|
||||
15
|
||||
@@ -452,12 +460,17 @@ null
|
||||
{"foo": 42}
|
||||
{"foo": 43}
|
||||
|
||||
.[] += 2, .[] *= 2, .[] -= 2, .[] /= 2
|
||||
.[] += 2, .[] *= 2, .[] -= 2, .[] /= 2, .[] %=2
|
||||
[1,3,5]
|
||||
[3,5,7]
|
||||
[2,6,10]
|
||||
[-1,1,3]
|
||||
[0.5, 1.5, 2.5]
|
||||
[1,1,1]
|
||||
|
||||
[.[] % 7]
|
||||
[-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7]
|
||||
[0,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,0]
|
||||
|
||||
.foo += .foo
|
||||
{"foo":2}
|
||||
|
||||
Reference in new issue
Block a user