Re: [SPAM-bayes] Re: [cx-oracle-users] float vs. int
Brought to you by:
atuining
From: Geoff G. <ge...@ge...> - 2003-10-06 19:18:04
|
Quoting Anthony Tuininga (an...@co...): > The only possibility that I can think of right now is that they incur > the overhead of checking if trunc(result) == result and returning an > integer as a result. That has two problems with it, though. (1) the > performance penalty and (2) the possibility of getting back an integer > when you wanted a float DCOracle and DCOracle2 both returns a float in this (select count(*)) case. For columns with a precision > 9 and a scale 0, DCOracle2 returns a Long by default, without comparing the actual value to sys.maxint. DCOracle compares the actual value and returns a Long only if an Int would overflow. DCOracle does all its data conversion by poking around inside Oracle's data structures, I think. I don't know the OCI API very well but very few OCI calls are actually being made by DCOracle. DCOracle2 seems to use slightly more of the OCI API, but the code is nowhere near as clean and comprehensible as the code in cx_Oracle. I prefer the DCOracle behavior only because I have coded to it in the past. I think the DCOracle behavior makes reasonable sense, but the DCOracle2 behavior does, too. Of course, I've already voted... ;) I don't deal with a lot of large numeric values, but I am a little concerned about FP "roundoff" and FP precision errors, and returning all values as strings is interesting but incurs more overhead than I'm willing to stomach. Just hoping to add some points of comparison to the discussion. Thanks, --G. -- Geoff Gerrietts "Whenever people agree with me I always <geoff at gerrietts net> feel I must be wrong." --Oscar Wilde |