|
you, !
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
You actually had sunshine in Wales?!
(I'm more likely to believe that you saw elephants. )
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.
--Winston Churchill
|
|
|
|
|
No often, no ... and it would appear that today will be another wet and grey one.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: wet and grey one
Are you still talking about elephants?
|
|
|
|
|
Wales is full of elephants - you just can't see them because they're so well camouflaged against the sky.
98.4% of statistics are made up on the spot.
|
|
|
|
|
You must be referring to the grey elephants. I'm referring to the pink ones.
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.
--Winston Churchill
|
|
|
|
|
|
Signed (integer) division. Where your faith in the sanity of arithmetic first starts to crumble.
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Not at all; it's only when integer division is being simulated with floating-point division that things go wrong. But it's floating-point division's fault.
|
|
|
|
|
|
PIEBALD boots up his MicroVAX and enters a darkened chamber...
VAX BASIC V3.9-000
Ready
PRINT MOD(-1,20)
-1
Ready
For added points, Turbo BASIC (sorry, the color didn't come over):
┌──────────────────────────────── Turbo Basic ─────────────────────────────────┐
│ File Edit Run Compile Options Setup Window Debug │
└──────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────── Edit ────────────────────────────────┐┌ Trace ┐
│ E:NONAME.BAS Line 1 Col 19 Insert Indent Tab ││ │
│10 PRINT -1 MOD 20 ││ │
│ ││ │
│ ││ │
│ ││ │
│ ││ │
│ ││ │
│ ││ │
│ ││ │
│ ││ │
│ ││ │
│ ││ │
└─────────────────────────────────────────────────────────────────────┘│ │
┌────────────── Message ───────────────┐╔════════════ Run ════════════╗│ │
│ Compiling: NONAME │║-1 ║│ │
│ Time: 00:00 │║ ║│ │
│ Line: 1 Stmt: 3 Free: 370k │║ ║│ │
│ │║ ║│ │
│ │║ ║│ │
└──────────────────────────────────────┘╚═════════════════════════════╝└───────┘
Alt-F5-Zoom Alt-F6-Next
|
|
|
|
|
PIEBALDconsult wrote: (sorry, the color didn't come over)
You could have posted a link to the screenshot, or code the color in HTML yourself
Jokes apart
Turbo Basic is not unknown for me. But VAX? I never saw it
Edit:
Quote: VAX BASIC User Manual. Order Number: AA-HY158-TE. February 1990. This manual describes how to develop VAX BASIC programs, describes the features of Ok... I think I already know why...
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Unlike the newer DEC/COMPAQ/HP BASIC that I have on my AlphaServers and Itanium, VAX BASIC still has immediate mode.
|
|
|
|
|
Lot's of work went into that
I am not the one who knocks. I never knock.
In fact, I hate knocking.
|
|
|
|
|
Starting to think people post kid pics in their profiles because that was the last time they were cute - Jeremy Falcon.
|
|
|
|
|
Fantastic!!
I'm actually literally LOLing.
|
|
|
|
|
Bewdy, had hoped I wouldn't be the only one prepared to admit it.
|
|
|
|
|
|
|
It is hard to say 'wrong' or 'right'...
The Euclidean way is much more perfect (consistent) and fits better math as science, however Donald Knuth promoted an other way (called floored division), which found to be better for computer science and used by most languages today...
Modulo operation - Wikipedia[^] - there is a nice table on the left side about programming languages...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
Kornfeld Eliyahu Peter wrote: It is hard to say 'wrong' or 'right'
Yes, I agree... except of course the one that returns -1 is right.
Just kidding. I really do agree.
Kornfeld Eliyahu Peter wrote: Donald Knuth promoted an other way (called floored division), which found to be better for computer science and used by most languages today.
Very interesting and I agree that this version is better for computer science.
|
|
|
|
|
raddevus wrote: Python and Ruby are garbage languages and I'm sure this will be their end.
I would also include some others like Javascript, but at least it knows its math and so it lives on (for now).
-1%20 = 19 is so counter intuitive, I don't know how they reached that conclusion, however, we can see here that in Python the result of a modulo(%) operation has to be of the same sign and strictly smaller than the second operand.
Edit:
And so python says
print 1%-20; = -19.
print -1%-20; = -1. (finally)
Someone needs to go back to the math class they hated.
I am not the one who knocks. I never knock.
In fact, I hate knocking.
modified 30-Aug-17 4:50am.
|
|
|
|
|
GKP1992 wrote: -1%20 = 19 is so counter intuitive,
I agree. It is interesting that a small number of languages use this different way which is maybe more loyal to math.
|
|
|
|
|
Well done
Starting to think people post kid pics in their profiles because that was the last time they were cute - Jeremy Falcon.
|
|
|
|
|