- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
We're talking assignment-y stuff, so read it right-to-left…
Admin
"Assign to y the value of assign to x the value of x divided by 2"
..... that didn't help.
Admin
Assign to
xit's value divided by 2, and assign the result of that (which is the new value ofx) toyas its initial value. (The order of evaluation is a separate matter, but that doesn't apply here since there's no assign-use dependencies in the statement or function calls.)I could have written:
but that would have taken two lines, and would have required a C99-ism too, and I still mostly try to avoid those. ;)
Admin
.... frack. i got my left and rights mixed up again.
there's a reason i always write road directions in terms of "drivers turns" and "passenger turns"
Admin
“Turn right now!” … “No, I meant the opposite right!”
Admin
exactly.
Admin
HARD TO STARBOARD.
Body is invalid? Wat?
Admin
At least it's descriptive?
Admin
It could be more so, just a smidgen.
Admin
My point is, It used to say post not descriptive enough if your post is all caps. But yes, it's a slight improvement I guess?
Admin
Sure. "Something is wrong with your post" > "Something is wrong".
Admin
Hey, @Boner, how's it hangin'?
:giggity: :rimshot:
Admin
What, not HARD TO PORT?
Admin
He's a little different...
Admin
I was going to go with HARD TO PORT but I was on mobile and it was too much effort.
Admin
What's all this about docking?
:giggity:
Admin
Danger Will Robinson.... what happen for sqrt(0) ?
Admin
I did say “about”… :smiley:
Admin
For square-root you can use Newton Raphson method as you can find the differential.
Otherwise you could get 2 values, an overestimate and an underestimate and use one of the merging techniques (binary search / secant method / Brent interpolation)
I recently worked somewhere where I replaced binary search interpolation for Brent and it sped up enormously.
If they ask you, describe these different interpolation methods. Brent is a mix of various ones.