Omega Centauri
Reputation
968
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
4 8
Newest
Impact
~40k people reached

• 0 posts edited
• 0 helpful flags
• 0 votes cast

# 65 Actions

 Mar 4 awarded Nice Answer Nov 27 awarded Yearling Nov 27 awarded Yearling Dec 25 awarded Nice Answer Nov 27 awarded Yearling Nov 27 awarded Yearling Aug 29 awarded Nice Answer May 17 comment Explaining floating point precision to customers You can make it a multistep problem. Start with the identity x=sqrt(x)^2, then this implies x=(sqrt(sqrt(x))^2)^2. generalize for N repeated square roots and squares. The bigger N the more precision is lost. Plot the error as a function on N. May 1 comment Why are structs/arrays zero based? Thanks Mike. I've mainly been a Fortran programmer, and thats how the Fortran mod operator works, so its not surprising C works the same way. Apr 28 comment Using single characters for variable names in loops/exceptions If I had to work with you, we'd have a religious war/Jihad. Apr 28 comment Using single characters for variable names in loops/exceptions I really like your analogy to pronouns. Also some fields have importanat quantities with simple names, and lots of literature using them in a standard way. For instance if you are solving for light intesity problems then I(angle) is the intensity of light at a given angle, and the clode is clearest if that is what you use. The ickyest thing is to have to figure out what a messy algebraic expression means when all the variables are twenty or thirty characters long). I'm sorry my brain can't fathon algebra with long variable names, but has no trouble with short ones. Apr 24 comment Why are structs/arrays zero based? Yes, but that means in C you have to remember to dimension your coefficient array by n+1, which is oh so easy to forget. Apr 24 comment Why are structs/arrays zero based? Yes. I think C started with the mentality of an assembly programmer. And in assembly it was convenient to use a pointer to the adrress of the zeroth element, and add size times the index to that. Apr 24 comment Why are structs/arrays zero based? Addressing arithmetic is easier with zero based, the array pointer points to index zero. It also works naturally with the mod function, for example if a[n] is meant to be a periodic array I can address it as a[j%n] quite naturally. However I don't know how many errors have happened when people mistakingly address a[n]. I prefer the Fortran approach, where you can specify the index as a range, for example dimension a2d(10:20,-5:5). To do that in C requires some tricky address algebra. Apr 23 comment Most Efficient Cache Replacement Algorithm When I hear "cache" I think of the storage between memory and the CPU registers. Here you are talking about disk cache, which is a layer inbetween memory and one or more i/o devices. Apr 23 comment Most Efficient Cache Replacement Algorithm Main memory may be cheap, but if performance is an important issue, access efficiency will matter. I don't think you get to choose your cache replacement strategy -unless you are a chief architect of a new computer. The rest of us get whatever the market offers. If you need to go fast, you need to organize your computation and data structures to make efficient usage of the memory hierarchy. Mar 26 answered Scientific evidence that supports using long variable names instead of abbreviations? Mar 26 answered What is the difference between a floating decimal number and fixed decimal number? Mar 13 comment How do you manage frequent software releases to multiple clients? This is very similar to our process. Our heavy users spend most of their professional live using the code, and are always making suggestions, sometimes even submitting desired code patches for features thay consider critical. Some bug fixes, or feature enhancements we might only make available in the Beta, if the code change looks to be risky. Our application is highly techical with very sophisticated users. Other application areas could have quite different characteristics. Mar 8 answered Idea for a physicsâ€“computer science joint curriculum and textbook