SHOULD OBJECTS BE REPRESENTED BY USER-DEFINED scalar. Note

SHOULD OBJECTS BE REPRESENTED BY USER-DEFINED scalar. Note that the number of fields required to represent a value does not determine whether or not it is a scalar; we saw the date example at the beginning of this chapter that had three fields but was still a scalar. Is a geometric point a scalar? No, because its representation requires two dimensions, not just two numbers. But why is a date that has three numbers a scalar but a point that has only two numbers associated with it not a scalar? You can ask of any date something like Is date d2 between date d1 and date d3? and get a consistent answer. But there is no way in general to consistently answer the question Is point p2 between point p1 and point p3? The reason you can t get a consistent answer to this question for points is that each answer to a between question makes a commitment to the next. For example, consider the following questions and answers. Is date d2 between date d1 and date d3? Yes. Is date d4 between date d1 and date d2? Yes. If someone then asks, Is date d4 between date d1 and date d3? the answer must be yes. This is because dates have an order they in effect map onto the real number line. In fact, internally SQL Server can use floating point numbers to represent dates because of this. This is not true for points, because they are not scalars. One of the problems with asking a between question of points is that our conventional notion of between would require all three of the points involved to be on the same line. If we use this kind of definition of between for points, there are many points for which we cannot answer the between question, because it makes no sense. But if we can just come up with an alternate definition of between that works consistently, we can still consider points to be scalars. Let s try to make up something that is similar to the way between works for dates. For dates, we can say that d2 is between d1 and d3 if both abs(d2 -d1) Java Web Hosting services

Bookmark the permalink.

Comments are closed.