On 23/04/13 03:04, Peter Bigot wrote: > On Mon, Apr 22, 2013 at 6:56 PM, Paul Sokolovsky <pmis...@gmail.com > <mailto:pmis...@gmail.com>> wrote: > > Hello, > > On Tue, 23 Apr 2013 00:56:40 +0200 > David Brown <david.br...@hesbynett.no > <mailto:david.br...@hesbynett.no>> wrote: > > > "Shift" does not have a "correct classification" or other "officially > > correct" mathematical definition. It is not one of the standard > > operations defined on integers. > > Of course it is - proceed to http://en.wikipedia.org/wiki/Logical_shift > or open up your Computer Science book. (And of course, whenever we speak > of integers in Computer Science, we speak of finite subset of math > integers, and those map directly to bit vectors on which shift is > defined). > > > I believe David was referring to mathematics, where a shift relative to > a finite set of integral values is essentially an algebraic operation. > The closest analog to "int" in standard mathematics would probably be a > group, ring, or (probably not) field; in any case, not something where > logical or arithmetic shifts are primitive operations. If it were > well-defined mathematically, the C language might not be justified in > leaving the operation undefined. > > Computer science often defers to mathematics for this sort of thing, but > in practice it takes leave to use a functional definition in certain > cases, which does indeed depend on the computing model you use. >
(This is more to Paul than Peter here.) That's correct. Computer science is a mathematical science, but for many things the "normal maths" concepts are not the same as those used in practical computer science. In real maths, integers are unbounded and real numbers have infinite precision. In abstract computer science, you often treat integers as unbounded - when doing algorithm design you generally don't want to bother about extra details. But at the implementation level, integers will be bounded. The exact algebraic form of these integers is implementation dependent, as are the operations on it (and they are not simply a subset of the mathematical integers Z - it's more complex than that) - and they are dependent on both the underlying hardware and the programming language. > > > > So it does what you define it to do in the context. > > No, that's not how science works - there's one definition for one > notion, "you" (as a subjective observer) is excluded. > > > I think that's an unrefined position. I propose that a defensible > definition of "science" is "the consensus interpretation of repeatable > observations", which is both subjective and temporal. Reference Thomas > Kuhn. There is a big difference between "mathematics" and "science". In mathematics, there /are/ fixed rules and mathematical facts are provably correct from a given set of axioms. (There's lots of interesting maths that is /not/ provable, but that's another side issue.) In science, there are no absolute facts - only working theories that fit the real world. So a "scientific fact" is, as you say, a consensus - it is a theory that is considered strong enough and useful enough that it is accepted until something better comes along. Abstract "computer science" is, in fact, a branch of mathematics rather than a science. When you derive a new sorting algorithm, you /prove/ it to be correct from your set of axioms (which include things like the rules for comparison and data swapping, and abstract ideas such as unbounded integers and storage space). Real-world implementations are a bit more "scientific" - you assume that your processor works as intended because that's what happens in practice, rather than because you can /prove/ that it works. > That, though, is a discussion best held at a coffee shop or quiet > bar amongst a group of cross-disciplinary graduate students, and mostly > irrelevant to how a C compiler does or should handle integer operations. > A mailing list discussion with a coffee cup on the desk beside the computer is about the best I can get since my student days long ago. > Damn, I miss those days. I know what you mean. David > > Peter ------------------------------------------------------------------------------ Try New Relic Now & We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr _______________________________________________ Mspgcc-users mailing list Mspgcc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mspgcc-users