24 march
On 24 March, Pierre Hugonett wrote:
> Alois Steindl wrote:
> >
> > Hello,
> > let me explain the server and client view again:
> >
> > A: Server view with 2 precisions:
> >
> > You provide 3 routines:
> > a) sum (x single, accu single)
> > b) sum (x single, accu double)
> > c) sum (x double, accu double)
> >
> > With more precisions you need more routines.
> >
> > B: Client:
> > call sum (x(p), accu(2p)) (p precision, not kind)
> >
> > Then the proper routine will be selected.
> >
> > There might be a superfluous argument, but it seems to be necessary
> > to distinguish the cases.
>
> This is one possible solution to the problem.
>
> Another close solution could be providing as argument
> the desired precision of accu, and duplicating the
> code inside the routines.
>
> But I don't like a lot providing as arguments variables
> which should be local variables.
Alois's suggestion is not providing as an argument a local variable.
It's just providing a second argument that will distinguish
between the two cases (a) and (b).
The corresponding dummy argument does not need to be used
or referenced at all (inside the function).
If optional arguments are used, the second (optional) argument
needs to be given in only one case. Again, the corresponding
dummy argument would not be used or referenced.
> Best regards,
> | Pierre Hugonnet
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|