Operator MOD
#33
Mod won't be modified because QB64 is dedicated to being QuickBASIC compatible with the goal being programs will run the same, in terms of output, on both platforms.

I find the function for recognizing patterns good enough for any situation I have encountered. I just coded an even better update for integers with this single line not conditions needed update...

Code: (Select All)
$CONSOLE:ONLY
' Testing modx 5
FOR i = 20 TO -20 STEP -1
    i$ = LTRIM$(STR$(i))
    LOCATE , 4 - LEN(i$): PRINT LTRIM$(STR$(i));: LOCATE , 5: PRINT "modx j ="; modx(i, 5)
NEXT
SLEEP
' Testing modx -5
FOR i = 20 TO -20 STEP -1
    i$ = LTRIM$(STR$(i))
    LOCATE , 4 - LEN(i$): PRINT LTRIM$(STR$(i));: LOCATE , 5: PRINT "modx j ="; modx(i, -5)
NEXT

FUNCTION modx (i, j)
    modx = (ABS(i) - ABS(j) * ((ABS(i) \ ABS(j)) + (1 - SGN(i)) \ 2)) * SGN(i MOD j)
END FUNCTION

So to me this is not a pressing issue. I'd put it left down (as apposed to right up) there with making SELECT CASES, but you never know. If a current dev or someone new comes along who has a personal fascination with topic, something might get pushed to the repo.

My advice would be if you want to lobby for it, Since Steve doesn't appear interested, I'd recommend sending a PM to Matt (DSMan195276) or luke.

In conclusion, if MOD were buggy, I'm pretty certain the dev team would be all over it, but as I stated earlier the QB version of MOD works correctly as designed, and although there is absolute merit in an operator as you described, well, there are a lot of developed functions built into calculators that are not made as keywords in a computer language. That's why many of us build routines like String Math and decfloat.


Pete
Reply


Messages In This Thread
Operator MOD - by Chris - 11-27-2022, 07:09 PM
RE: Operator MOD - by Pete - 11-27-2022, 07:35 PM
RE: Operator MOD - by Chris - 11-27-2022, 07:47 PM
RE: Operator MOD - by SMcNeill - 11-27-2022, 08:03 PM
RE: Operator MOD - by Chris - 11-27-2022, 08:17 PM
RE: Operator MOD - by Pete - 11-27-2022, 08:23 PM
RE: Operator MOD - by Chris - 11-27-2022, 08:30 PM
RE: Operator MOD - by SMcNeill - 11-27-2022, 08:44 PM
RE: Operator MOD - by mnrvovrfc - 11-27-2022, 08:32 PM
RE: Operator MOD - by bplus - 11-27-2022, 08:42 PM
RE: Operator MOD - by Chris - 11-27-2022, 08:54 PM
RE: Operator MOD - by SMcNeill - 11-27-2022, 08:57 PM
RE: Operator MOD - by SMcNeill - 11-27-2022, 09:02 PM
RE: Operator MOD - by Jack - 11-27-2022, 09:02 PM
RE: Operator MOD - by Chris - 11-27-2022, 09:02 PM
RE: Operator MOD - by SMcNeill - 11-27-2022, 09:06 PM
RE: Operator MOD - by Chris - 11-27-2022, 09:08 PM
RE: Operator MOD - by Chris - 11-27-2022, 09:14 PM
RE: Operator MOD - by Jack - 11-27-2022, 09:18 PM
RE: Operator MOD - by Pete - 11-27-2022, 09:23 PM
RE: Operator MOD - by Chris - 11-27-2022, 09:28 PM
RE: Operator MOD - by Chris - 11-27-2022, 09:52 PM
RE: Operator MOD - by Pete - 11-27-2022, 10:41 PM
RE: Operator MOD - by mnrvovrfc - 11-28-2022, 01:17 AM
RE: Operator MOD - by mnrvovrfc - 11-28-2022, 04:01 AM
RE: Operator MOD - by mnrvovrfc - 11-28-2022, 02:57 AM
RE: Operator MOD - by Pete - 11-28-2022, 03:21 AM
RE: Operator MOD - by Jack - 11-28-2022, 10:13 AM
RE: Operator MOD - by Kernelpanic - 11-28-2022, 04:03 PM
RE: Operator MOD - by Jack - 11-28-2022, 11:56 AM
RE: Operator MOD - by Chris - 11-28-2022, 03:21 PM
RE: Operator MOD - by Chris - 11-28-2022, 04:06 PM
RE: Operator MOD - by Pete - 11-28-2022, 07:02 PM
RE: Operator MOD - by mnrvovrfc - 11-28-2022, 08:23 PM
RE: Operator MOD - by SMcNeill - 11-28-2022, 09:54 PM
RE: Operator MOD - by mnrvovrfc - 11-28-2022, 10:10 PM
RE: Operator MOD - by Pete - 11-28-2022, 10:23 PM
RE: Operator MOD - by Kernelpanic - 11-29-2022, 11:12 PM
RE: Operator MOD - by SMcNeill - 11-28-2022, 10:33 PM
RE: Operator MOD - by Kernelpanic - 11-28-2022, 11:46 PM
RE: Operator MOD - by mnrvovrfc - 11-29-2022, 12:10 AM
RE: Operator MOD - by Pete - 11-29-2022, 12:00 AM
RE: Operator MOD - by Kernelpanic - 11-29-2022, 12:05 AM
RE: Operator MOD - by SMcNeill - 11-29-2022, 12:35 AM
RE: Operator MOD - by Kernelpanic - 11-29-2022, 12:25 AM
RE: Operator MOD - by Pete - 11-29-2022, 12:36 AM
RE: Operator MOD - by bplus - 11-29-2022, 01:29 AM
RE: Operator MOD - by Pete - 11-29-2022, 01:42 AM
RE: Operator MOD - by bplus - 11-29-2022, 04:41 AM
RE: Operator MOD - by SMcNeill - 11-29-2022, 06:24 AM
RE: Operator MOD - by SMcNeill - 11-29-2022, 06:34 AM
RE: Operator MOD - by bplus - 11-29-2022, 12:27 PM
RE: Operator MOD - by Pete - 11-29-2022, 11:58 PM
RE: Operator MOD - by Kernelpanic - 11-30-2022, 02:50 AM
RE: Operator MOD - by SMcNeill - 11-30-2022, 03:49 AM
RE: Operator MOD - by Kernelpanic - 12-01-2022, 12:41 AM
RE: Operator MOD - by vince - 11-30-2022, 12:41 PM
RE: Operator MOD - by Chris - 12-03-2022, 08:19 AM
RE: Operator MOD - by SMcNeill - 12-03-2022, 08:31 AM
RE: Operator MOD - by Pete - 12-03-2022, 09:06 AM
RE: Operator MOD - by mnrvovrfc - 12-03-2022, 11:56 AM
RE: Operator MOD - by SMcNeill - 12-03-2022, 12:08 PM
RE: Operator MOD - by Kernelpanic - 12-03-2022, 05:07 PM
RE: Operator MOD - by Pete - 12-03-2022, 05:12 PM
RE: Operator MOD - by Kernelpanic - 12-03-2022, 05:20 PM
RE: Operator MOD - by SMcNeill - 12-03-2022, 12:30 PM
RE: Operator MOD - by mnrvovrfc - 12-03-2022, 12:31 PM
RE: Operator MOD - by Pete - 12-03-2022, 03:31 PM
RE: Operator MOD - by DSMan195276 - 12-03-2022, 05:57 PM
RE: Operator MOD - by Kernelpanic - 12-03-2022, 06:48 PM
RE: Operator MOD - by Pete - 12-03-2022, 06:05 PM



Users browsing this thread: 29 Guest(s)