[fpc-pascal] default parameter single = NaN

David Emerson dle3ab at angelbase.com
Tue Jun 21 00:12:09 CEST 2016


On 06/20/2016 02:53 PM, Martin wrote:
> 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;
>

Thanks, Martin! This is much better.





More information about the fpc-pascal mailing list