LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-18-2013, 12:46 AM   #16
laho
LQ Newbie
 
Registered: May 2009
Distribution: Debian, Ubuntu
Posts: 10

Rep: Reputation: 0

Quote:
Originally Posted by curious95 View Post
Thank you, i've understood what to do Sorry laho guess i thought binary addition would be 'harder' than that.
No prob. That's why computers use it because it's easy to do.
 
Old 01-18-2013, 12:50 AM   #17
curious95
Member
 
Registered: Oct 2012
Location: /home/v
Distribution: Slackware 14.0
Posts: 83

Original Poster
Rep: Reputation: Disabled
Good idea will check it out.
 
Old 01-20-2013, 04:37 PM   #18
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by curious95 View Post
How do i add two four bit numbers, what are the steps required to do so?
Start from here: https://en.wikipedia.org/wiki/Positional_notation .


Modern world appears to be completely dumbed down - we were taught the above at school, before age of 17.
 
Old 01-20-2013, 04:39 PM   #19
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by laho View Post
No prob. That's why computers use it because it's easy to do.
No.

Computers don't care - they are not humans.
 
Old 01-20-2013, 06:22 PM   #20
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,193

Rep: Reputation: 538Reputation: 538Reputation: 538Reputation: 538Reputation: 538Reputation: 538
Quote:
Originally Posted by Sergei Steshenko View Post
Start from here: https://en.wikipedia.org/wiki/Positional_notation .


Modern world appears to be completely dumbed down - we were taught the above at school, before age of 17.
This is severely OT, but the description of number systems reminded me of former employer I worked for. The owner of that company was a genius, but also of a bit a nerd as happens so often with smart people. Our workstations were W 3.11, but for the servers etc he insisted on Solaris. This was 1992, so Linux was not really widespread.

He insisted on a standard file name convention, wich was FILENAME.YMD. 8.3 filenames only, remember? So to write YMD, we used that last digit of the year, the month in base-12, and the day in base-31. Base-31 is not difficult, just continue to use alphanumerics after F... After some practicing most of us could remember the ordinals of the characters by heart. I have been using this base-31 file extensions for many years after that, until the 8.3 filenames completely disappeared.

jlinkels
 
Old 01-20-2013, 09:48 PM   #21
suicidaleggroll
Senior Member
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 3,144

Rep: Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108
Quote:
Originally Posted by jlinkels View Post
He insisted on a standard file name convention, wich was FILENAME.YMD. 8.3 filenames only, remember? So to write YMD, we used that last digit of the year
It is amazing how many programmers still use this incredibly short-sighted practice. Not just single digit years, 2 digit years are nearly as bad. In the next 40 years we are going to be facing a shitstorm of "if (2digityear < 50) then 4digityear=2digityear+2000 else 4digityear=2digityear+1900" breakdowns across the board. Even now, when file name and memory space restrictions are almost non-existent, I still see programmers using this practice all over the place.

It gets me all worked up...sorry about the tangent.
 
Old 01-20-2013, 10:01 PM   #22
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,193

Rep: Reputation: 538Reputation: 538Reputation: 538Reputation: 538Reputation: 538Reputation: 538
I think you are right about the laziness/shortsightedness of certain programmers, but with 8.3 filenames there was little other choice. Maybe 8.3 was not such a good idea.

jlinkels
 
Old 01-22-2013, 02:37 PM   #23
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Quote:
Originally Posted by sundialsvcs View Post
It's exactly like base 10: 0 + 1 = 1 ... etc[/b] ... 1 + 1 = 1 carry 1.

It does take a bit of getting used two ...
I think that should be 1 + 1 = 0 carry 1.

My inner pedant emerges again. Someone should have noticed that after the old "10 people...." thing came up.

While tempting to bash Microsoft for the whole 8.3 filename thing, I'm fairly sure it was a deliberate choice to be compatible with CP/M.

--- rod.

Last edited by theNbomr; 01-22-2013 at 02:42 PM.
 
  


Reply

Tags
bit


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add decimal numbers in Linux MinuPriya Linux - Newbie 5 08-11-2010 01:31 AM
How to add numbers in JComboBox vibinlakshman Programming 1 02-21-2009 03:10 PM
manipulating 64 bit numbers using 32 bit numbers. rajesh_b Programming 3 09-15-2006 10:03 AM
Help.. how do I add two numbers? Tengil Linux - Newbie 3 03-04-2004 01:58 PM
C, read 8 bit octal numbers, convert to 24 bit binary bamalabs Programming 3 01-20-2004 10:59 AM


All times are GMT -5. The time now is 04:03 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration