That's fine, thanks. It's between integers and floating points actually, so
declaring the floating point one with Extended is better, I guess.
--
View this message in context:
http://old.nabble.com/Help-creating-generic-class%3A-division-problem-tp28140305p28147009.html
Sent from the Free Pascal
If it is only between int and double, maybe this will help
have on overload function
class function TMedian.Div(Value, Divider: Integer): Integer; // Result
:= Value div Divider
class function TMedian.Div(Value, Divider: Double): Double; // Result
:= Value / Divider
then the compiler choose
consider the following generic class declaration:
{$mode objfpc}{$H+}
type
generic TMedian = class
class function Find(x: array of T): T;
end;
class function TMedian.Find(x: array of T): T;
var
i, j, Middle: Integer;
Temporary: T;
begin
// Use truncated selection sort to find medi