Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement MOD operator #4

Closed
nippur72 opened this issue Apr 23, 2020 · 4 comments
Closed

implement MOD operator #4

nippur72 opened this issue Apr 23, 2020 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@nippur72
Copy link
Contributor

it would be nice to have the MOD operator, sometimes you need it and you have to emulate it via INT().

@leomil72
Copy link
Owner

I already thinked about it, but not yet found the time to do it

@leomil72 leomil72 added the enhancement New feature or request label Apr 24, 2020
@leomil72 leomil72 added this to the R3.7 milestone Apr 25, 2020
@leomil72
Copy link
Owner

Implemented

@nippur72
Copy link
Contributor Author

great! Microsoft BASIC has it as MOD instead of %, if you want to make it more compatible with GW-BASIC etc. The integer division is also \ (backslash) but I understand you can't type it on the C16 keyboard :-)

Anyway they are a good addition to the language, well done!

@leomil72
Copy link
Owner

Yes I know about MOD statement but other languages use single chars operands (i.e. C/C++) and I liked this way and though it was easier (it is more convenient when typing lists: 1 char instead of 3 chars). Moreover, when you port a program from another BASIC dialect you know that you have to make some adaptations, like LOCATE that it doesn't work like in GW-BASIC (I use the format X,Y for coordinates, while GW-BASIC uses Y,X), so I think that this was not a great problem.
Same for integer division operand: I didn't have the \ char on the C16 keyboard. I could have used # instead of other chars (i.e., I evaluated ÷, too, that it's available with C= and /) that are not present on the keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants