This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
3
Which of the following lines will be faster?
Post Flair (click to view more posts with a particular flair)
Post Body
I initially wrote few formula like this,
Proj.Dx = (float)(cos(Days[k].Alpha / RtoD) * cos(Days[k].Gamma / RtoD));
Proj.Dy = (float)(cos(Days[k].Alpha / RtoD) * cos((90 - Days[k].Gamma) / RtoD));
Will making it write like this make any any faster? The first component to be multiplied is the same.
Proj.Dy = (float)(cos(Days[k].Alpha / RtoD));
Proj.Dx = Proj.Dy*(float)cos(Days[k].Gamma / RtoD);
Proj.Dy *= (float)cos((90-Days[k].Gamma) / RtoD);
also, writing (float) to convert rhe value of cos from double to float necessary?
The 'k' is an iterator and the loop goes for 8000 times. Hence was wondering if the difference in writing these lines make any difference.
Author
Account Strength
100%
Account Age
7 years
Verified Email
Yes
Verified Flair
No
Total Karma
16,841
Link Karma
7,126
Comment Karma
9,655
Profile updated: 1 week ago
Posts updated: 10 months ago
Subreddit
Post Details
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 5 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/cpp_questio...