Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12345»»»

Exponent Engima Expand / Collapse
Author
Message
Posted Wednesday, August 06, 2008 10:09 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Friday, March 28, 2014 2:25 PM
Points: 9,902, Visits: 9,479
Comments posted to this topic are about the item Exponent Engima

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Post #547995
Posted Thursday, August 07, 2008 2:07 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, March 03, 2014 8:29 AM
Points: 1,865, Visits: 584
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
Post #548066
Posted Thursday, August 07, 2008 2:38 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, April 15, 2014 7:19 AM
Points: 2,814, Visits: 3,851
What a nasty question... :P
Is this standard SQL behaviour or just MS style?


Best Regards,
Chris Büttner
Post #548082
Posted Thursday, August 07, 2008 3:25 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld 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?
Post #548106
Posted Thursday, August 07, 2008 4:18 AM


SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Tuesday, February 04, 2014 8:18 AM
Points: 620, Visits: 273
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.
Post #548139
Posted Thursday, August 07, 2008 4:26 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, March 03, 2014 8:29 AM
Points: 1,865, Visits: 584
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
Post #548149
Posted Thursday, August 07, 2008 4:44 AM


SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Tuesday, February 04, 2014 8:18 AM
Points: 620, Visits: 273
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.
Post #548161
Posted Thursday, August 07, 2008 7:28 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Friday, March 28, 2014 2:25 PM
Points: 9,902, Visits: 9,479
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."
Post #548276
Posted Thursday, August 07, 2008 7:34 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Friday, March 28, 2014 2:25 PM
Points: 9,902, Visits: 9,479
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."
Post #548284
Posted Thursday, August 07, 2008 7:42 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Friday, November 22, 2013 11:05 AM
Points: 3,108, Visits: 2,116
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."
Post #548291
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse