Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Chit Chat

Post new topic   Reply to topic
Why "<>" is "not equal"
View previous topic :: View next topic  
Author Message
DoobieKeebler
Moderator


Joined: 17 Jun 2005
Posts: 254
Location: 181°15'2.003"W, 93°5'16.956"N

PostPosted: Aug 23rd, 2005 08:53 AM    Post subject: Why "<>" is "not equal" Reply with quote

(I think this qualifies as "off topic".)

Here's one that had me puzzled for the first few years I was programming. (I started programming back in '81 and have been a hobbyist ever since.) In an If statement, "=" is "equals", "<" is "less than", and ">" is "greater than". Simple stuff.

But "<=" is "less than or equal to" and ">=" is "greater than or equal to". So why is "<>" "not equal to"? In a way it's not. It's "less than or greater than".

There are three states of equality, as listed above: equal to, less than, and greater than. If it's less than or greater than then it cannot be equal to. So VB sees the test as "less than or greater than", it's just us programmers (note the proper use of the word "us") that see it as "not equal".
Back to top
View user's profile Send private message
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Aug 23rd, 2005 02:24 PM    Post subject: Reply with quote

In other languages it's != I think (in C, right?)... I guess they wanted to be original? Biggrin
_________________
No one is completely useless. They can at least be an example of what to avoid.
Back to top
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
dougthomas
Moderator


Joined: 27 Jul 2005
Posts: 271
Location: Essex, UK

PostPosted: Aug 24th, 2005 05:43 AM    Post subject: Reply with quote

Hi,

Here's my pennyworth......

Taking Doobie's logic:

=< means Equal to or Less than
>= means Greater than or Equal to
= Means Equal to

it follows the <> must be Not Equal to

Think of:

If 3 =< 4 then...... 3 is less than 4 (True) or equal to 4 (False)
True Or False = True

If 4 >= 3 then...... 4 is greater than 3 (True) or equal to 3 (False)
True Or False = True

if 4 = 3 then......... (False) 4 doesn't equal 3
False = False

If 4 <> 3 then...... 4 is not less than 3 (False) or 4 is greater than 3 (True)
False Or True = True


Thinking about it, if a number is less than another number OR it's greater than that number then it can't possibly be equal to it !!

I think it was DeMorgan's Theory: A or B = NOT(A and B) and Not A or NOT B = NOT(A AND B) and if you play with that for long enough you can prove the above. (I can't but you may be able to !!)


QED !

Regards
Doug
PS In my day (early '70's) in Fortran it was .EQ.,.NE.,.GT.,.GE.,.LT.,.LE.)
Back to top
View user's profile Send private message
DoobieKeebler
Moderator


Joined: 17 Jun 2005
Posts: 254
Location: 181°15'2.003"W, 93°5'16.956"N

PostPosted: Aug 24th, 2005 09:29 AM    Post subject: Reply with quote

It's actually clever when you think of it. BASIC is one of the "prehistoric" languages created when memory was tight and you needed to code as efficiently as possible. If you already have a construct (not sure I'm using the right word here) that can handle two tokens, why create a unique token when you can pass the construct two tokens it can already deal with?

Since you go back that far Doug, you might know this. I've heard it but for me it was just trivia. What was the floppy disk size biger than 5.25"? 7 7/8" comes to mind but so many things come to mind that never were.
Back to top
View user's profile Send private message
dougthomas
Moderator


Joined: 27 Jul 2005
Posts: 271
Location: Essex, UK

PostPosted: Aug 24th, 2005 10:17 AM    Post subject: Reply with quote

The early ones were 8 inch, then a "standard" of 5.25 inch appeared when Microcomputers "DOS" came along.

Also, Amdahl and later IBM (or the other way round) used 12 inch floppies for IMPL (Initial MicroProgram Load) for their Processors and Disc Controllers. Think I've got one or two somewhere, togehter with the Card Punch and platter of real Core Store from a KDF9 (suspect your parents weren't born when that was running !!)

Regards
Doug
Back to top
View user's profile Send private message
vbman995
Moderator


Joined: 19 Aug 2005
Posts: 264
Location: Planet Earth

PostPosted: Aug 26th, 2005 06:15 PM    Post subject: Reply with quote

Hey, I still have a 5.25 inch floppy. It is the coolest thing ever! It is neat to know that at one time, that 5.25 floppy was the best technology that was around. Now we have thumb drive that hold upto 4 Gigs. (I think the max I have seen so far is 4 gigs.)
Back to top
View user's profile Send private message
DoobieKeebler
Moderator


Joined: 17 Jun 2005
Posts: 254
Location: 181°15'2.003"W, 93°5'16.956"N

PostPosted: Aug 29th, 2005 09:42 AM    Post subject: Reply with quote

Yeah, but that's 4GB before it's formatted, right?. My DVD+RW disc gives me 4.3GB formatted. One day this too shall be quaint. ("Grandpa, how did you ever get by with a 120GB hard drive? I'm gonna have to add another 100PB [pecabyte, 1,048,576 GB] drive soon.")
_________________
Always take into account what a user would never ever in a million years do, because someone will.

"In theory, there's no difference between theory and practice. In practice, there is." -- Yogi Berra
Back to top
View user's profile Send private message
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Aug 29th, 2005 02:37 PM    Post subject: Reply with quote

DoobieKeebler wrote:
Yeah, but that's 4GB before it's formatted, right?. My DVD+RW disc gives me 4.3GB formatted. One day this too shall be quaint. ("Grandpa, how did you ever get by with a 120GB hard drive? I'm gonna have to add another 100PB [pecabyte, 1,048,576 GB] drive soon.")


Tha'ts so sad and true at the same time Smile My parents still tell me that they used to manage with 50MB and I start laughing Biggrin
_________________
No one is completely useless. They can at least be an example of what to avoid.
Back to top
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
dougthomas
Moderator


Joined: 27 Jul 2005
Posts: 271
Location: Essex, UK

PostPosted: Aug 31st, 2005 05:56 AM    Post subject: Reply with quote

One of the first machines I worked on was an ICL 470, it had a "multiuser" operating system (called MultiJob) and we had 385Kb of memory for programs to run in. No Virtual storage - what you saw was what you got.The interactive bit was through ASR33 teletypes.

Even so we had 3 "streams", RIRO - you prog would load & run for a given time and then "roll-out" to let another one in, this went on in a circular fashion until your prog finished (it was nearly Virtual Memory, except you got dumped out to staging and then reloaded). Your prog had to be less than 64K though to qualify for RIRO. The other two were batch, one to support the printers and card and paper tape readers and the other for "Commercial" progs such as Payrolls and things. Backing storage was a mixture of removable disks. (8 Mb , 30Mb and 60Mb) and Tape Drives (800 bpi, 1600bpi and (later on) 6250bpi. We had enough tape to circumnavigate the Universe at least twice! The Operating system ran of one of the 8Mb disks. (and there was still space for a development system)

The compiler and linker technology was, IMHO, *very* advanced, programs would be segmented so that bits could be overlayed on each other to conserve memory and whilst "event driven code" wasn't known as such you had to write the code in a structured manner where you knew that a particular bit wasn't going to be used again so it could be overlayed with the next bit. If you take a standard model of a program, it is in 3 bits, input, processing and output. The first level of segmentation would be on each bit (once you've done all the input, you can overlay that with the processing and when that finished you could overlay that with the output, just have some "common areas" between each one to pass information.) Next level would be within the processing etc etc. Everything was reentrant and serially reusable as well. I used to write a lot of 370 Assembler routines for the Fortran community to keep storage down to a minimum, loads of self modifying code as well.

Ah, those were the days, then Virtual Memory came along and spoiled it all !!

Regards
Doug
Back to top
View user's profile Send private message
vbman995
Moderator


Joined: 19 Aug 2005
Posts: 264
Location: Planet Earth

PostPosted: Sep 14th, 2005 02:01 PM    Post subject: Reply with quote

DoobieKeebler wrote:
Yeah, but that's 4GB before it's formatted, right?. My DVD+RW disc gives me 4.3GB formatted. One day this too shall be quaint. ("Grandpa, how did you ever get by with a 120GB hard drive? I'm gonna have to add another 100PB [pecabyte, 1,048,576 GB] drive soon.")


Its kind of annoying that when you shop for a computer they say for example, 160 GB hard drive and they might really give you 145 GB after they have loaded all of the OS and other stuff they put on there. Once of my friends has a Commador Computer.....The type you plug into a tv for a display!
Back to top
View user's profile Send private message
dougthomas
Moderator


Joined: 27 Jul 2005
Posts: 271
Location: Essex, UK

PostPosted: Sep 14th, 2005 02:10 PM    Post subject: Reply with quote

Hey, there's nothing wrong with the Commadore 64 I've got one in the attic together with the B/W TV I used to use it with.
_________________
If you can see the light at the end of the tunnel, it probably means there's a Train coming.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Chit Chat All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic