How to calculate Fibonacci with template?

B

bert

to ensure the complexity is O(1).THX~

Work out your own recurrence relation which
approximately doubles the index at each step.
{F} = ... 3, 5, 8, ... 55, 89, ...
and: 55 = 8^2 - 3^2, 89 = 8^2 + 5^2.
--
 
L

Les Cargill

Kenny said:
But there is in C/C++/C# - which is what most people really mean nowadays
when they refer to "C".


I don't think anybody confuses C# with the other two. C# was
specifically designed as a heresy on C++ - for "the language
business" at you-know-where.
 
K

Kenny McCormack

I don't think anybody confuses C# with the other two. C# was
specifically designed as a heresy on C++ - for "the language
business" at you-know-where.

Heh heh. I hear ya. And I did just throw in the C# reference to further
annoy the regs here - as if the sight of those 2 plus signs following the
name of their beloved language wasn't enough.

But, seriously folks, from what I hear, in the "business" world these days,
C# *is* pretty much considered to be the current incarnation of C. Even C++
is considered to be a "legacy language".
 
S

Shao Miller

Heh heh. I hear ya. And I did just throw in the C# reference to further
annoy the regs here - as if the sight of those 2 plus signs following the
name of their beloved language wasn't enough.

I don't understand why you'd want to do that.
But, seriously folks, from what I hear, in the "business" world these days,
C# *is* pretty much considered to be the current incarnation of C. Even C++
is considered to be a "legacy language".

It's fun that the '#' can be decomposed into 4 tiny '+' signs, perhaps
resulting an operation like: (c++)++ Unfortunately, that operation
doesn't work, in C.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top