[fpc-pascal] default parameter single = NaN

Martin fpc at mfriebe.de
Mon Jun 20 23:53:54 CEST 2016


On 20/06/2016 22:45, David Emerson wrote:
> I found a workaround, which is to use Infinity as the default value, 
> instead of NaN. It's acceptable for my use, though a little awkward.
there is another workaround.

Do not repeat the default value at implementation.
Declare as
   function make_scale_matrix (zx:single; zy:single=NaN):t_2d_affine;

But implement as
   function make_scale_matrix (zx:single; zy:single):t_2d_affine;
   begin
   end;




More information about the fpc-pascal mailing list