implement `mod` resource (% operator)
See original GitHub issueIf we have division and multiplication operators, we should also have a modulo operator. However, currently it does not exist.
🦄 40/6
float ask(call(get('/'),40,6))
6.666666666666667
🦄 40*6
int ask(call(get('*'),40,6))
240
🦄 .editor
// Entering editor mode (^D to finish, ^C to cancel)
40%6
Uncaught Error: Unknown identifier '%'!
at Object.<anonymous> (/Users/milimetr/Desktop/x/askql/dist/askvm/lib/run.js:70:15)
at Generator.next (<anonymous>)
at /Users/milimetr/Desktop/x/askql/dist/askvm/lib/run.js:8:71
at new Promise (<anonymous>)
at __awaiter (/Users/milimetr/Desktop/x/askql/dist/askvm/lib/run.js:4:12)
at Object.run (/Users/milimetr/Desktop/x/askql/dist/askvm/lib/run.js:29:12)
🦄
This task is to create a mod
resource and a %
operator linked to this resource.
–
Dear new contributor,
If you have any questions on how to start, please write a comment with a tag: @czerwinskilukasz1 or @mhagmajer, or join our Discord Community and let us know there. We will be very happy to help you start! 😃
Hint for starters: As a starting point, take a look at src/askvm/resources/math/index.ts
file, where a *
operator and times
resource are already linked or a couple of other ones and use them as an example.
Cheers, Łukasz (@czerwinskilukasz1) AskQL Core Developer
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (1 by maintainers)
Top Results From Across the Web
Mod Operator - Visual Basic - Microsoft Learn
The Mod operator in Visual Basic, the .NET Framework op_Modulus operator, and the underlying rem IL instruction all perform a remainder ...
Read more >Python Modulo in Practice: How to Use the % Operator
One of these operators is the modulo operator ( % ), which returns the remainder of dividing two numbers. In this tutorial, you'll...
Read more >Modulo operator (practice) | Cryptography - Khan Academy
Learn for free about math, art, computer programming, economics, physics, chemistry, biology, medicine, finance, history, and more. Khan Academy is a ...
Read more >Efficient C Tip #13 – use the modulus (%) operator with caution
This is the thirteenth in a series of tips on writing efficient C for embedded systems. As the title suggests, if you are...
Read more >The Modulo operator Unplugged
The Modulo operator Unplugged · Printables · Classroom resources · Programming challenges · Table of contents · Key questions · Lesson starter ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
%
: https://github.com/xFAANG/askql/issues/264@czerwinskilukasz1 let’s do it in parser only for operators,
div
andmod
and carry the discussion about unary%
on a separate issue