[fpc-pascal] default parameter single = NaN

David Emerson dle3ab at angelbase.com
Tue Jun 21 00:07:08 CEST 2016


On 06/20/2016 02:43 PM, Jonas Maebe wrote:
> On 20/06/16 22:59, David Emerson wrote:
>> Error: function header doesn't match the previous declaration
>>
>> for a (non-method) function that does exactly match its previous
>> declaration:
>>
>> function make_scale_matrix (zx:single; zy:single=NaN):t_2d_affine;
>
> It's probably due to a peciularity of the "NaN" value itself: if you ask
> a floating point unit to compare NaN with NaN, the returned result must
> always be "not equal" even though the bit patterns match exactly. To fix
> this, the compiler will have to compare the bit patterns of floating
> point default parameters rather than their values as floating point
> numbers.
>
> Please file a bug report.
>
>
> Jonas


filed

~David





More information about the fpc-pascal mailing list