What other languages, beside Transact SQL, state that 22/7 is equal to 3? [closed]
https://softwareengineering.stackexchange.com/questions/107987
题
I was using Microsoft SQL Query Analyzer the other day and wrote a very simple select statement:
SELECT 22/7 as [PI Equiv]
I was suprized that the result was 3, when I was expecting to see 3.1428571. Even if you declare the output to be Numeric(18,7)
, you still get 3.0000000.
DECLARE @Answer Numeric(18,7)
SET @Answer = 22/7
SELECT @Answer as [PI Equiv]
RESULT = 3.0000000
What other languages return integer values when the dividend and divisor are both integers?
没有正确的解决方案