I don't Get It.
Right parameter is TRoundToRange not single,double or extended.
In that case howto get roundto with extended precision ?
function RoundTo(const AVAlue: Extended; const Digits: TRoundToRange):
Extended;


2013/3/6 Jonas Maebe <jonas.ma...@elis.ugent.be>:
>
> On 22 Feb 2013, at 13:30, to...@ump.edu.pl wrote:
>
> s1,s2: extended;
>
> s1:=291.022;
> s2:=roundto(s1,-30);   //TRoundToRange = -37..37;
>
> give me Invalid floating point operation.
>
> I see that roundto goes to single instead of extended. But why ?
>
>
> Because overload selection is based on parameter matching from right to
> left, and -30 can be exactly represented using "single" and hence is
> converted to that type by the compiler when it has to turn it into a
> floating point constant.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to