5 ms·
Is the angle -90 equal to 270? Is the quotient 1/2 equal to 3/6 Is the string "Bébé" equal to "Bebe"? Is the float 0.555555559 equal to 0.6? Is the color RG
by Coincoin 10y ago
Is the angle -90 equal to 270?
Is the quotient 1/2 equal to 3/6
Is the string "Bébé" equal to "Bebe"?
Is the float 0.555555559 equal to 0.6?
Is the color RGB(1,1,1) equal to Lab(100,0,0)?
Is the equation y=3x+2 equal to y-2=3x?
Is the function x=>2+x equal to y=>2+y?
- jstimpfle 10y ago> Is the angle -90 equal to 270? > Is the quotient 1/2 equal to 3/6? I think these are good examples that come up in the real world a lot. The representation structures we use are not sufficient for precise specification. So we have to overspecify (making a superfluous choice in representation, -90, 270, 630?). My opinion still is that data must be normalized with explicit procedure calls. Doing stuff implicitly is neither beneficient to efficiency nor to comprehensibility. Explicit normalization allows to leverage what the compiler _can_ infer. The other questions I have to return because it's not even clear to me, "Should they be"?
- mbrock 10y agoWhether they should be depends on your needs, so it's nice to be able to choose the equality semantics for your application's types.
- dllthomas 10y ago> My opinion still is that data must be normalized with explicit procedure calls. Doing stuff implicitly is neither beneficient to efficiency nor to comprehensibility. It can certainly benefit comprehensibility. Needing to explicitly normalize before I can apply standard comparisons leaves more space for things to go wrong. "Having a value of this type means that I have a normalized value" means I have fewer things to keep track of. (I do note that there is significant space between "it can benefit comprehensibility" and "it will always benefit comprehensibility" - that depends on what I need to be readily able to pull out of the implementation from a quick read of surface syntax) Also, some things may have an easy equality check while normalizing may be expensive or impossible - although I sadly can't think of any examples off the top of my head.
- noobermin 10y ago>Is the equation y=3x+2 equal to y-2=3x? Sorry, had to be pedantic. These equations are not equal under usual mathematical and logical definitions of equality applied to equations. They do possibly express the similar relationships between the variables. But I agree with your general point. "Equals" has different definitions in different contexts.
- dllthomas 10y ago> These equations are not equal under usual mathematical and logical definitions of equality applied to equations. They do possibly express the similar relationships between the variables. Could you elaborate? The second sentence in particular surprises me - don't these necessarily express exactly the same relationship between the variables?
- Ntrails 10y agoI'm not sure he's right at all. I'd define any equation "a" which can be re-arranged to equation "b" to be equal ie. a==b They are the same thing. Thusly y=3x+2 is equal to 10y-20=30x is equal to 5y-15x=10 etc It's been a while since uni, but I don't remember any other mathematical definition of equations being considered equal. I guess the thought is something about what is being defined in terms of what (y= vs x=) but I don't think that's a meaningful distinction between two equations.
- cmrx64 10y agoTurns out, there are many more interesting equivalence relations on values than simply structural equality!
- dllthomas 10y ago> Is the angle -90 equal to 270? This is trickier than it might seem. Is this a description of static geometry, or is this a delta that I'm going to want to interpolate/integrate/etc? In the latter case, -90 is very different than 270, which is different than 630...