Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
409 views
in Technique[技术] by (71.8m points)

operator keyword - What is the meaning of a dot (.) after an integer in c?

I would like to know if anybody knew what a . after an integer in C means.

i have this piece of code i want to convert and that is the only thing i am not sure of what it does.

if (y>=0.) what does the . here do?

full code:

double angleOf(double x, double y) {

  double  dist=sqrt(x*x+y*y) ;

  if (y>=0.) return acos( x/dist);
  else       return acos(-x/dist)+.5*CIRCLE_RADIANS; }
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It's same as 0.0, it will treat it as double instead of an integer, so you don't need to cast it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...