J
Jon Harrop
Ben said:That is a known issue which I spoke of in my first post in this thread.
C++0x fixes that too.
Has C++0x ever been implemented?
Generics, which are early bound, don't provide parametric polymorphism.
I suggest you read up on parametric polymorphism.
What part of "both double and decimal" didn't you understand?
"decimal" because it is meaningless.
And why would different algorithms be needed?
Because these types have completely different properties in this context:
.. Ints do not accumulate round-off error. Floats do.
.. The "/" operator you use is Euclidean quotient for ints and an
approximation to real division for floats.
In C++ the same algorithm
will work for both int and float (until overflow becomes a problem, but
the accumulator can be a different type) except for roundoff, which is
expected for int.
As I thought, your algorithm is broken. This is difficult to demonstrate
because you failed to provide working C++ code.
through the use of JIT?
FFTW precompiles the most common codelets and puts them in its standard
library. With a JIT, you can compile any codelet as and when you need it.
No, as I recall the comparison process is very slow (I may be thinking of
ATLAS rather than FFTW), and the compile time is only a small fraction of
that.
That is generally the case, yes.
Oh, F# defines the bitwise and operation for all types it pretends to
implement INumeric for?
No, the INumeric interface is only used for the n.One and n.Zero. The
inlining makes this function generic over everything else just like a C++
template.
It's not part of the INumeric interface.
Yes.
It's not even part of the IIntegral interface.
Yes, of course.
And it must turn that into something pretty ugly in order for the CLR to
accept it.
I've no idea how it is compiled but it provides strictly more functionality
than your C++ template.
If they are so trivial, how come .NET generics can't solve them?
How come a ripe banana can't solve them?
Nobody cares when modern languages are more expressive in every respect.