Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / undefined - Forty Different Programming Languages Solve Fibonacci's Problem

Author
Message
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 8th Feb 2014 08:37
This is a very nice demonstration of many languages, most of which I've never heard of.
http://www.scriptol.com/programming/fibonacci.php

Formerly OBese87.
nonZero
12
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 8th Feb 2014 09:21
Yay for me, I've heard of at least 60% to 70% of them. However the number I can code in is only a handful and the number I've any real experience with is even less. Back on-topic, it's not surprising that a problem like that is solvable. With the abilities to use logic and iterate through a pattern, computers can solve most problems mathematically.

Formerly nonZero
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 8th Feb 2014 12:46
It's easy to forget just how unusual COBOL was, looking at it now it's almost like the code is making demands - if Skynet was real, it would be written in COBOL.

I am the one who knocks...
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 10th Feb 2014 13:36
Can anyone add an industrial-standard language to the list that isn't there?

I have worked for years with RPG/400 and RPG IV. here is the code is RPG IV:



Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 10th Feb 2014 16:29 Edited at: 10th Feb 2014 16:31
I hated coding in cobol. Never again I said!

I came across a method recently that made clever use of an array and modulo for an iterative method.




This method is non-iterative nor recursive, but seems to lose precision after the 32nd number in the series. Maybe a DB limitation?



Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th Feb 2014 13:45 Edited at: 14th Feb 2014 13:46
I was surprised to see ALGOL and PL1 absent from that list - and also amazed to see Cobol mentioned.

Quote: "Maybe a DB limitation?"


You're using floats - bound to give problems in an iteration like that.



Powered by Free Banners
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 14th Feb 2014 17:21 Edited at: 14th Feb 2014 17:21
Quote: "This method is non-iterative nor recursive, but seems to lose precision after the 32nd number in the series. Maybe a DB limitation?"

I would guess:

sqrt(5) ~ 2;
232 is 32-bits, so I'm guessing this breaks down because floats are stored in 32 bits? (Are they? Not actually certain on that.)

Formerly OBese87.
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 14th Feb 2014 17:27
Typically floats are stored as dwords (doublewords, 2 bytes per word, so 4 bytes, or 32 bits)

I am the one who knocks...

Login to post a reply

Server time is: 2024-05-08 03:50:07
Your offset time is: 2024-05-08 03:50:07