Thread overview
Properties - A question
Apr 13, 2004
Scott Egan
Apr 13, 2004
J Anderson
Apr 14, 2004
Manfred Nowak
Apr 14, 2004
J Anderson
April 13, 2004
Below is the info on properties copied from http://www.digitalmars.com/d/property.html.

Is the 'float.nan' comment correct?  If so would some kind person put me straight.

ta


Every type and expression has properties that can be queried:
	int.sizeof	// yields 2
	float.nan	// yields the floating point value
	(float).nan	// yields the floating point nan value
	(3).sizeof	// yields 4 (because 3 is an int)
	2.sizeof	// syntax error, since "2." is a floating point number
	int.init	// default initializer for int's


April 13, 2004
Scott Egan wrote:

>Below is the info on properties copied from
>http://www.digitalmars.com/d/property.html.
>
>Is the 'float.nan' comment correct?  If so would some kind person put me
>straight.
>  
>
Must be a typo.  I mean as proof try this:

   printf("%f", float.nan);   //nan
   printf("%f", (float).nan); //nan

>ta
>
>
>Every type and expression has properties that can be queried:
>	int.sizeof	// yields 2
>	float.nan	// yields the floating point value
>	(float).nan	// yields the floating point nan value
>	(3).sizeof	// yields 4 (because 3 is an int)
>	2.sizeof	// syntax error, since "2." is a floating point number
>	int.init	// default initializer for int's
>
>
>  
>


-- 
-Anderson: http://badmama.com.au/~anderson/
April 14, 2004
J Anderson wrote:

[...]
> Must be a typo.
[...]

What are both of you talking about?

So long!

April 14, 2004
Manfred Nowak wrote:

>J Anderson wrote:
>
>[...]
>  
>
>>Must be a typo.
>>    
>>
>[...]
>
>What are both of you talking about?
>
>So long!
>
>  
>
The comment on float.nan is missing the word "nan".

	float.nan	// yields the floating point value
	(float).nan	// yields the floating point nan value


-- 
-Anderson: http://badmama.com.au/~anderson/