Re: Big numbers



marc wrote:
On 13 jan, 20:17, Lew Pitcher <lpitc...@xxxxxxxxxxxx> wrote:

However, the onus is on the OP to determine what "Decimal" means.
Additionally, the documentation on his DBMS API would/should provide
information on how the API converts database values ("Decimal", etc.) to C
datatypes, and what C datatypes the API will populate.

Decimal is a standard Sybase data type.
It's converted into C double data type.
It works in 99.999% of cases.
But not for this big number...

Well, that would appear to be at least part of your problem. On many
systems (including the one I'm using right now), 'double' has
insufficient precision to represent all of the significant digits in
that number. When you say "It is converted into C double data type",
you're using the passive voice, leaving it unclear what it is that is
doing the conversion. If it's being done by SYBASE, then you need to
find a way to convince SYBASE to give you the value as a long double
(how you do that is off-topic in this newsgroup). On the other hand,
if your own code performs the conversion, then the solution is to
rewrite that code to convert it to long double.
.



Relevant Pages

  • Re: Big numbers
    ... information on how the API converts database values ... datatypes, and what C datatypes the API will populate. ... Decimal is a standard Sybase data type. ...
    (comp.lang.c)
  • Re: Why C?
    ... The API results in C code that is not easy to follow. ... automatic conversion and negligible help in the Visual C++ 6.0 compiler. ... So, for code longevity, simple charactre prompts, using Fortran, seems to be ... C++, then Java (less so, for direct hardware access), then C# (again, less ...
    (comp.compilers.lcc)
  • Re: [RFC] callout overhaul: part I
    ... and we should integrate that into my API proposal. ... You have chosen "callout" but I'm not sure I like that very much, ... want to have the per-cpu option, ... You propose a two-stage conversion. ...
    (freebsd-arch)
  • Re: [PATCH 0/7] sg_ring: a ring of scatterlist arrays
    ... The way we've been doing the sg_chain conversion is to slide API layers ... it didn't touch any drivers. ... Scatterlists are the way the block ...
    (Linux-Kernel)
  • Re: [PATCH 0/7] sg_ring: a ring of scatterlist arrays
    ... The way we've been doing the sg_chain conversion is to slide API layers ... And don't even think of joining mapped chains: ... Scatterlists are the way the block ...
    (Linux-Kernel)