floats default to NaN... why?

Don Clugston dac at nospam.com
Tue Jun 5 00:25:29 PDT 2012


On 14/04/12 16:52, F i L wrote:
> On Saturday, 14 April 2012 at 10:38:45 UTC, Silveri wrote:
>> On Saturday, 14 April 2012 at 07:52:51 UTC, F i L wrote:
>>> On Saturday, 14 April 2012 at 06:43:11 UTC, Manfred Nowak wrote:
>>>> F i L wrote:
>>>>
>>>> 4) use hardware signalling to overcome some of the limitations
>>>> impressed by 3).
>>>
>>> 4) I have no idea what you just said... :)
>>
>> On Saturday, 14 April 2012 at 07:58:44 UTC, F i L wrote:
>>> That's interesting, but what effect does appending an invalid char to
>>> a valid one have? Does the resulting string end up being "NaS" (Not a
>>> String)? Cause if not, I'm not sure that's a fair comparison.
>>
>> The initialization values chosen are also determined by the underlying
>> hardware implementation of the type. Signalling NANs
>> (http://en.wikipedia.org/wiki/NaN#Signaling_NaN) can be used with
>> floats because they are implemented by the CPU, but in the case of
>> integers or strings their aren't really equivalent values.
>
> I'm sure the hardware can just as easily signal zeros.

It can't.


More information about the Digitalmars-d-learn mailing list