Oracle Consulting Oracle Training Oracle Support Development
Home
Catalog
Oracle Books
SQL Server Books
IT Books
Job Interview Books
eBooks
Rampant Horse Books
911 Series
Pedagogue Books

Oracle Software
image
Write for Rampant
Publish with Rampant
Rampant News
Rampant Authors
Rampant Staff
 Phone
 800-766-1884
Oracle News
Oracle Forum
Oracle Tips
Articles by our Authors
Press Releases
SQL Server Books
image
image

Oracle 11g Books

Oracle tuning

Oracle training

Oracle support

Remote Oracle

STATSPACK Viewer

Privacy Policy

 

   
  SQL Server Tips by Burleson

Real and float

Real is a floating point numeric value with valid values –3.40E + 38 through -1.18E - 38, 0 and 1.18E - 38 through 3.40E + 38.
Float has valid values - 1.79E + 308 through -2.23E - 308, 0 and 2.23E -308 through 1.79E + 308.
The following example shows how a real value is stored using 32 bit IEEE single-precision:

DECLARE @r real
SET @r=12345.67
SELECT @r, DATALENGTH(@r)
SELECT CAST(@r as binary(4))

12345.67 4
0x4640E6AE

Converting 4640E6AE to binary:

0 10001100 10000001110011010101110
S EEEEEEEE FFFFFFFFFFFFFFFFFFFFFFF
0 1 8 9 31


S is the sign of the mantissa, E the exponent and F is the decimal part of the mantissa.

S=0, E=140, F=81CD5C => 1.F=1.81CD5C=1.50703979

Using the IEEE formula:

V=(-1)^S*2^(E-127)*(1.F)=(-1)^0*2^(140-127)*(1.50703979)=1*8192*1.50703979=12345.66995968=12345.67


The above book excerpt is from:

Super SQL Server Systems
Turbocharge Database Performance with C++ External Procedures

ISBN: 0-9761573-2-2
Joseph Gama, P. J. Naughter

 http://www.rampant-books.com/book_2005_2_sql_server_external_procedures.htm  

Linux Oracle commands syntax poster

ION Oracle tuning software

Oracle data dictionary reference poster



Oracle Forum

BC Oracle consulting support training

BC remote Oracle DBA   

 

   

 Copyright © 1996 -2016 by Burleson. All rights reserved.


Oracle® is the registered trademark of Oracle Corporation. SQL Server® is the registered trademark of Microsoft Corporation. 
Many of the designations used by computer vendors to distinguish their products are claimed as Trademarks
 

Hit Counter