Collections:
Performing Comparison on Floating Point Numbers in SQL Server
How To Perform Comparison on Floating Point Numbers in SQL Server Transact-SQL?
✍: FYIcenter.com
Comparison operations on approximate (floating point) numbers are also easy to understand. Just watch out rounding operations performed during conversions. Here are two examples of floating point number comparisons:
-- Rounding during implicit conversion makes them equal DECLARE @x FLOAT(24), @y FLOAT(24); SET @x = 0.999999999E+00; SET @y = 0.99999999E+00; SELECT CASE WHEN @x <> @y THEN 'True' ELSE 'False' END; GO False -- Floating point number literals have double precision -- So no rounding SELECT CASE WHEN 0.999999999E+00 <> 0.99999999E+00 THEN 'True' ELSE 'False' END; GO True
⇒ Performing Comparison on Date and Time Values in SQL Server
⇐ Performing Comparison on Exact Numbers in SQL Server
⇑ Boolean Values and Logical Operations in SQL Server Transact-SQL
2017-01-21, 1565🔥, 0💬
Popular Posts:
How To Create a Dynamic Cursor with the DYNAMIC Option in SQL Server Transact-SQL? If the underlying...
How To Connect the Oracle Server as SYSDBA in Oracle? This is Step 4. The best way to connect to the...
How To Verify a User name with SQLCMD Tool in SQL Server? The quickest way to verify a user name in ...
Where to find answers to frequently asked questions on CREATE, ALTER and DROP Statements in MySQL? H...
How To Format Time Zone in +/-hh:mm Format in SQL Server Transact-SQL? From the previous tutorial, y...