cast question.

Dahe Chen chen-dahe at CS.Yale.EDU
Thu Jan 26 10:18:20 AEST 1989


It may be a stupid question but I am perplexed by the code like
the following:

...

doubel A , B ;

...

if( (int) A <= (int) B ) {
    statement1 ;
} else {
    statement2 ;
}

...

I am having the case that the integral parts of A and B are equal and
the control goes to statement2. My question is that am I casting A and
B to integers properly. If not, what is the correct way. Please e-mail
to me.

Thanx in advance.

-------
Dahe Chen
internet:   dchen at twolf.ce.yale.edu ( @venus.ycc.yale.edu )
	    chen-dahe at cs.yale.edu
bitnet:	    dchen at yalevms



More information about the Comp.lang.c mailing list