Re: Big numbers



marc wrote:
On 13 jan, 19:54, "Joachim Schmitz" <nospam.j...@xxxxxxxxxxxxxxxxxx>
wrote:

The question is not (primarily) how it is stored in the DB, but how you get
it out of that DB.

My problem is how to store it in C.
It's not important that it comes from a database.

You're correct. Where it comes from is unimportant. However, what form
it's stored in after the database query is very important, because the
correct way to print it depends upon what form it arrives in.

let's say I have :

unsigned long long u = 33748440199875750.25;

You're initializing 'u' with a floating point constant. That constant
has, by default, a type of 'double', which on most machines has
insufficient precision to hold all of the significant digits in that
number, which means it doesn't actually represent the value it appears
to represent. The best it can do is represent a 'double' value that is
as close as possible to the one specified, and that's not sufficiently
close to keep the last three digits accurate.

You could avoid that problem by adding an L to the end of the
constant, which would force it to have the type "long double", which
often will have sufficient precision. However, even if you do that,
the digits after the decimal place would still be lost as soon as you
store it in an object of type unsigned long long int, because (as
implied by the 'int'), such a type can only store integers, it can't
store the fractional part of that number.

It is extremely unlikely that your data base query returns it's
results in the form of a numeric literal in your source code. That
would imply that query generates the source code for your program,
which you recompile and run after each query. If that's not how the
results of your query are stored in your program, then you need to
tell us how they are actually stored.
.



Relevant Pages

  • RE: Store Added Value List Items
    ... You could even union that query with the actual list from the form ... Each user in this database needs to have access to all the same customers. ... is praticle to create a seperate one field table to store values for a lookup ...
    (microsoft.public.access.formscoding)
  • Re: Involved query / possible over Access assistance.
    ... and that it related to normalization. ... >> This is the idea I want to try to implement in an access database. ... I want to store the dayof the week that the event ... >> I want to then do a query for a given week. ...
    (microsoft.public.access.queries)
  • Re: Form
    ... Some instruction of the fundamentals of database design may be in order. ... which is to say a table or query should be selected as its Record ... If you want to store data in the table by way of a form (which should always ... query as the form's Record Source, and select a field from the Record Source ...
    (microsoft.public.access.forms)
  • Involved query / possible over Access assistance.
    ... This is the idea I want to try to implement in an access database. ... I want to store the dayof the week that the event ... I want to then do a query for a given week. ... point during the week 1) display which dayof the week, ...
    (microsoft.public.access.queries)
  • RE: List of options
    ... > Private Sub StoreLstBxSelBtn_Click ... > of the field to store the temporary data in. ... > adds your question and the answers to the database of answers. ... >>> the list box can be set to this query. ...
    (microsoft.public.access.forms)