|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Wednesday, June 12, 2013 11:17 AM
Points: 9,855,
Visits: 9,376
|
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Thursday, June 13, 2013 2:48 AM
Points: 1,865,
Visits: 557
|
|
Oh, I fell for that one. good question, highlighting an incorrect assumption of mine (I neither use exponents nor bitwise XORs on a regular basis).
Thanks, Tom
Life: it twists and turns like a twisty turny thing
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 12:36 AM
Points: 2,547,
Visits: 3,648
|
|
What a nasty question... :P Is this standard SQL behaviour or just MS style?
Best Regards,
Chris Büttner
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Wednesday, September 24, 2008 1:27 PM
Points: 350,
Visits: 229
|
|
Got it right . Out of interest, what was the "@b bigint" for, to try and confuse people with the @b-17 answer :D?
|
|
|
|
|
SSChasing Mays
      
Group: General Forum Members
Last Login: Monday, April 29, 2013 7:32 AM
Points: 620,
Visits: 267
|
|
what a glitch!!
in BOL it says that SQRT ( float_expression ) and float could be, as definition of float, float - 1.79E+308 to -2.23E-308, 0 and 2.23E-308 to 1.79E+308 so, where it says that the argument of SQRT should be not negative!???
In Theory, theory and practice are the same...In practice, they are not.
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Thursday, June 13, 2013 2:48 AM
Points: 1,865,
Visits: 557
|
|
i think it is more a case of sql server probably not being able to handle complex numbers (the square root of a negative number).
Life: it twists and turns like a twisty turny thing
|
|
|
|
|
SSChasing Mays
      
Group: General Forum Members
Last Login: Monday, April 29, 2013 7:32 AM
Points: 620,
Visits: 267
|
|
yeah, but the question was from TSQL category. so, it supposed to be on sql issue and not sql server engine issue.
In Theory, theory and practice are the same...In practice, they are not.
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Wednesday, June 12, 2013 11:17 AM
Points: 9,855,
Visits: 9,376
|
|
hodgy (8/7/2008) Oh, I fell for that one. good question, highlighting an incorrect assumption of mine (I neither use exponents nor bitwise XORs on a regular basis).
Thanks, Tom
Thanks Tom. Yeah, hardly anyone does in SQL server, so that was the hidden corner I was aiming for.
-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung Proactive Performance Solutions, Inc. "Performance is our middle name."
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Wednesday, June 12, 2013 11:17 AM
Points: 9,855,
Visits: 9,376
|
|
Christian Buettner (8/7/2008) What a nasty question... :P Is this standard SQL behaviour or just MS style?
Standard ANSI SQL. The key is that "^" is NOT the exponent operator as many (including myself) have assumed and as it is in VB. Rather it is the bitwise XOR operator, as in C#, which of course gives completely different results. That is standard ANSI.
Square Root functions require non-negative inputs in virtually every production language ever, except those that have built-in complex numbers, like Fortan and ADA.
-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung Proactive Performance Solutions, Inc. "Performance is our middle name."
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Friday, May 17, 2013 2:11 PM
Points: 3,108,
Visits: 2,114
|
|
Cool question - I have not had to think about complex numbers, a+bi, since high school !
Regards Rudy Komacsar Senior Database Administrator
"Ave Caesar! - Morituri te salutamus."
|
|
|
|