1. Fibonacci solution on RosettaCode
- Posted by bruce1961 Jan 30, 2011
- 1624 views
I really like Euphoria! So incredibly expressive ...
I just put together a solution for Fibonacci Sequence, using an embedded byte-coded interpreter approach. I can see myself using this for quite a number of the other tasks.
Kind regards, Bruce.
2. Re: Fibonacci solution on RosettaCode
- Posted by coconut Jan 30, 2011
- 1628 views
I really like Euphoria! So incredibly expressive ...
I just put together a solution for Fibonacci Sequence, using an embedded byte-coded interpreter approach. I can see myself using this for quite a number of the other tasks.
Kind regards, Bruce.
Be serious, they where not asking for a compiler design exercice they were just asking for a fibonacci function. I added iterative and recursive version of it.
3. Re: Fibonacci solution on RosettaCode
- Posted by jimcbrown (admin) Jan 30, 2011
- 1601 views
I really like Euphoria! So incredibly expressive ...
I just put together a solution for Fibonacci Sequence, using an embedded byte-coded interpreter approach. I can see myself using this for quite a number of the other tasks.
Kind regards, Bruce.
There's actually a stdlib routine, math:fib() - though it suffers from the limitation of the maximum value that a double (64bit float) can store.
4. Re: Fibonacci solution on RosettaCode
- Posted by jimcbrown (admin) Jan 30, 2011
- 1605 views
I really like Euphoria! So incredibly expressive ...
I just put together a solution for Fibonacci Sequence, using an embedded byte-coded interpreter approach. I can see myself using this for quite a number of the other tasks.
Kind regards, Bruce.
Be serious, they where not asking for a compiler design exercice they were just asking for a fibonacci function. I added iterative and recursive version of it.
The stdlib version is just two lines:
include std/math.e ? fib(x)
It's implemented using the constant time formula.
public function fib(integer i) return floor((power( mathcons:PHI, i) / mathcons:SQRT5) + 0.5) end function
5. Re: Fibonacci solution on RosettaCode
- Posted by bruce1961 Jan 30, 2011
- 1570 views
Be serious, they where not asking for a compiler design exercice they were just asking for a fibonacci function. I added iterative and recursive version of it.
Okay, it was a bit over the top. But it was fun. And I learned a bit more about Eu4 in the process.