LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-29-2013, 11:05 AM   #16
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled

Quote:
Originally Posted by Didier Spaier View Post
I didn't vote for him.
 
Old 10-29-2013, 11:57 AM   #17
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Original Poster
Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
... founded Londinium, built some nice roads, built the baths at Bath, brought civilization, learning, language (well, thankfully, that didn't stick, English is Germanic), clean water, sewers (there's one at York that is still draining the Minster).

The good, the bad and ugly, too.
 
Old 10-29-2013, 01:18 PM   #18
neymac
Member
 
Registered: May 2009
Distribution: Slackware64-14.1
Posts: 138

Rep: Reputation: 19
Angry

Quote:
Originally Posted by volkerdi View Post
Oh, you need something to go along with this to do Arabic to Roman conversion? Here's a handy little program for that:
....
Save it as roman.cob and compile it with: cobc -x roman.cob

Enjoy!
I tested it with 487-> THE CORRESPONDING ROMAN NUMBER IS CCCCLXXXVII as result instead of CDLXXXVII (the right result), ENTER ANY NUMBER: 99
THE CORRESPONDING ROMAN NUMBER IS LXXXXVIIII (should be XCIX),
ENTER ANY NUMBER: 9
THE CORRESPONDING ROMAN NUMBER IS VIIII (should be IX, but maybe I did some mistake, who knows?) But I think this was not the main cause of the fall of the Roman Empire...

Last edited by neymac; 10-29-2013 at 01:30 PM.
 
Old 10-29-2013, 01:53 PM   #19
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Original Poster
Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Quote:
Originally Posted by neymac View Post
I tested it with 487-> THE CORRESPONDING ROMAN NUMBER IS CCCCLXXXVII as result instead of CDLXXXVII (the right result), ENTER ANY NUMBER: 99
THE CORRESPONDING ROMAN NUMBER IS LXXXXVIIII (should be XCIX),
ENTER ANY NUMBER: 9
THE CORRESPONDING ROMAN NUMBER IS VIIII (should be IX, but maybe I did some mistake, who knows?) But I think this was not the main cause of the fall of the Roman Empire...
Yup, same results with two separate converters. Maybe that's why nobody uses COBOL anymore -- maybe something to do with the year 2000 problem, eh?

However, the "wrong" conversions are actually correct, they're just too danged long (they convert to the correct integers properly).

Only the Shadow knows...

Last edited by tronayne; 10-29-2013 at 01:56 PM.
 
Old 10-29-2013, 03:46 PM   #20
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
I had a go as well.

This one uses the subtractive-notation rules as described on wikipedia.

I've attached one that converts both ways.

Last edited by GazL; 05-23-2014 at 11:51 AM.
 
2 members found this post helpful.
Old 10-29-2013, 07:58 PM   #21
qweasd
Member
 
Registered: May 2010
Posts: 621

Rep: Reputation: Disabled
a shorter version

Code:
function r2a () {
    echo $(( $(echo "$1" | \
	sed -e 's/iv/\+4/gI' -e 's/ix/\+9/gI' \
	-e 's/xl/\+40/gI' -e 's/xc/\+90/gI' \
	-e 's/cd/\+400/gI' -e 's/cm/\+900/gI' \
	-e 's/i/\+1/gI' \
	-e 's/v/\+5/gI' \
	-e 's/x/\+10/gI' \
	-e 's/l/\+50/gI' \
	-e 's/c/\+100/gI' \
	-e 's/d/\+500/gI' \
	-e 's/m/\+1000/gI')))
}
 
3 members found this post helpful.
Old 10-29-2013, 09:59 PM   #22
perbh
Member
 
Registered: May 2008
Location: Republic of Texas
Posts: 393

Rep: Reputation: 81
Quote:
Originally Posted by saulgoode View Post
When I was in school, those columns were used for sequence numbering of the cards. If you happened to drop your stack of cards then you could run them through a sorting machine that would arrange them based on the numbers in those columns. The keypunch would automatically add the sequence numbers as you created your code, or you could generate new sequence numbers when you made a copy of your card deck.
*chuckles* I had a collegue once who had a box of cards (3000 of'em) which were to be run through a card-punch to add sequence numbers. The cards contained numeric data. He stumbled over the threshhold and lost the box with the content spewing out - took him a week or so to get them all back in proper order!!
 
Old 10-29-2013, 10:00 PM   #23
neymac
Member
 
Registered: May 2009
Distribution: Slackware64-14.1
Posts: 138

Rep: Reputation: 19
Smile

Quote:
Originally Posted by GazL View Post
I had a go as well.

This one uses the subtractive-notation rules as described on wikipedia.

I've attached one that converts both ways.
Well done!
 
Old 10-29-2013, 10:03 PM   #24
perbh
Member
 
Registered: May 2008
Location: Republic of Texas
Posts: 393

Rep: Reputation: 81
Another collegue was going to a shipyard in Canada with a huge bunch of cards containing data for a vessel-build (numeric description of all the different steel-plates making up a vessel). He was stopped in custom and asked what he was bringing into the country. The custom officer picked up some cards and looked at them, then said: "Oh - they are all used! - please proceed"
 
Old 10-30-2013, 06:51 AM   #25
irgunII
Member
 
Registered: Jan 2012
Location: Directly above the center of the earth
Distribution: Slackware. There's something else?
Posts: 383

Rep: Reputation: 72
Quote:
Originally Posted by brianL View Post
I didn't vote for him.
I think they missed what you're refering to. I caught it instantly and got a nice chuckle out of it and sure enough even started to try and remember all the things they went through in the movie(s), heh heh.

"I mean....if I went 'round sayin' I was an emperor just because some moistened
bint lobbed a scimitar at me, they'd put me away!" -Dennis from Monty Python and
the Holy Grail

Last edited by irgunII; 10-30-2013 at 06:53 AM.
 
Old 10-30-2013, 09:15 AM   #26
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
"maybe something to do with the year 2000 problem, eh?" Actually, I think it was Y1K problem...
 
Old 10-30-2013, 10:12 AM   #27
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Original Poster
Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
And Admiral Hopper is possibly spinning in her tomb at the mere mention, eh?
 
Old 10-30-2013, 10:24 AM   #28
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Quote:
Originally Posted by Didier Spaier View Post
What's funny about your question is that word algorithm is derived from that of Persian mathematician عَبْدَالله مُحَمَّد بِن مُوسَى اَلْخْوَارِزْمِي‎ (in English Al-Khawarizmi), who introduced in Middle East then in Europe the so-called arabic numerals.

Also, word algebra is taken from part of the Arabic title of his best known book.

PS Now I'm sure NSA is watching me
Very interesting.

I'd like to mention that the numerals that we use today are not Arabic, although that is what everyone mistakenly believes. They are Hindu numerals. An Indian mathemetician invented it 800 years before the Arabs are claimed to have.

The more you know.
 
1 members found this post helpful.
Old 10-30-2013, 10:29 AM   #29
hpfeil
Member
 
Registered: Nov 2010
Location: Tucson, Arizona US
Distribution: Slackware Current
Posts: 354
Blog Entries: 1

Rep: Reputation: Disabled
I had to do that as a homework problem decades ago. Forgot what I did, though, it was in VAX MACRO assembler. Thanks for the reminder!
 
Old 10-30-2013, 10:55 AM   #30
qweasd
Member
 
Registered: May 2010
Posts: 621

Rep: Reputation: Disabled
Quote:
Now I'm sure NSA is watching me
How do you know NSA is watching you? Your modem light is blinking.
 
  


Reply

Tags
numbers



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
Numeral string compresion dth4h Programming 4 06-21-2012 09:17 PM
C++ Roman Numeral Converter ACSUSA Programming 3 02-24-2011 09:35 AM
'ls' .. or something to identify filenames that have a (space)(numeral) pattern rickh Programming 7 05-09-2006 01:51 AM
Times New Roman for Firefox? apachedude SUSE / openSUSE 0 11-30-2004 09:13 PM
Times New Roman-like fonts jrdioko Linux - Newbie 6 09-12-2004 07:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:05 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration