Re: i know it's a floating-point imprecision...
From: Steve Kass (skass_at_drew.edu)
Date: 01/26/05
- Next message: Geoff N. Hiten: "Re: Transaction Log behavior"
- Previous message: Gert E.R. Drapers: "Re: DBCC PROCCACHE Question."
- In reply to: Ian Boyd: "i know it's a floating-point imprecision..."
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 26 Jan 2005 14:50:25 -0500
Ian,
EM and ADO don't "fix" the precision, really. Unlike Query Analyzer,
those tools display floating point data with less precision. Where Query
Analyzer displays the closest 17-digit decimal value to the stored float,
other tools will display the closest 15- or 16-digit decimal value. No
front
end that I'm aware of displays the exact decimal equivalent of stored
floats.
You might store a float like pi() and see what each of these shows you.
Steve Kass
Drew University
Ian Boyd wrote:
>...but why is it fixing my floating-point imprecision?
>
>Running the following query:
> SELECT Value
> FROM Values
>
>On the table
> CREATE TABLE Values (Value float(53))
>
>In Query Analyzer:
> Value
> -----------------------------------------------------
> 1.3899999999999999
>
> (1 row(s) affected)
>
>
>In Enterprise Manager (Open table with query)
> Value
> 1.39
>
>In ADO, converting variant field to string:
> 1.39
>
>
>I understand that the value is stored in SQL Server using floating points.
>And that floating points cannot accuratly represent some/most numbers.
>But how is it that QA is able to show me the imprecision inherient in
>floating points; while EM and ADO can transparently "fix" it?
>
>What layer in the database connectivity sytem is able to "fix" my values?
>Why am i not allowed to see the approximate values in EM and ADO?
>
>
>Don't get me wrong, it's nice that ADO fixes it. I just want to know why and
>how.
>
>
>
>
- Next message: Geoff N. Hiten: "Re: Transaction Log behavior"
- Previous message: Gert E.R. Drapers: "Re: DBCC PROCCACHE Question."
- In reply to: Ian Boyd: "i know it's a floating-point imprecision..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|