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 6, 2008 10:09 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Today @ 11:54 AM
Points: 9,294, Visits: 9,492
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 7, 2008 2:07 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 6:06 AM
Points: 1,865, Visits: 594
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 7, 2008 2:38 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, October 7, 2014 2:56 AM
Points: 2,842, Visits: 3,876
What a nasty question... :P
Is this standard SQL behaviour or just MS style?


Best Regards,
Chris Büttner
Post #548082
Posted Thursday, August 7, 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 7, 2008 4:18 AM


SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Friday, September 19, 2014 12:29 AM
Points: 622, Visits: 287
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 7, 2008 4:26 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 6:06 AM
Points: 1,865, Visits: 594
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 7, 2008 4:44 AM


SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Friday, September 19, 2014 12:29 AM
Points: 622, Visits: 287
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 7, 2008 7:28 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Today @ 11:54 AM
Points: 9,294, Visits: 9,492
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 7, 2008 7:34 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Today @ 11:54 AM
Points: 9,294, Visits: 9,492
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 7, 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: Saturday, November 22, 2014 7:46 PM
Points: 3,220, Visits: 2,361
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