[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: Re: Problem with big integers
From: Stefan Nikolaus <stefan.nikolaus () kdemail ! net>
Date: 2007-01-30 16:46:05
Message-ID: 200701301746.13378.stefan.nikolaus () kdemail ! net
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
On Tuesday 30 January 2007 17:31:02 me wrote:
> On Monday 29 January 2007 11:45:01 Brad Hards wrote:
> > What I don't understand is why. Why not always just use a float, and
> > convert it in the asInteger() or asUnsignedLongLong() or whatever
> > functions?
>
> I was told, that long long is a C data type. Either way, I'd prefer to rely
> on Qt's platform independent qint64.
> But to your question: I see no good reason to store also the integer values
> in the double variable, whose mantisse is guaranteed to have 53 bits. The
> resulting range is -2^53 ... 2^53. Above (or below) it gets inaccurate. But
> that's at least more as long provides (at least): -2^31 .. 2^31-1.
>
> If nobody else objects and disabuses me, go ahead and modify Value to use
> the double variable also for the integers.
Thinking about it: Replacing the stored long variable by a qint64 one would
not need more space as before. The size of double is also 64 bit. I think, it
would: a) be easier/faster to change and b) prefered as we'll get a wider
range for integers: -2^63 ... 2^63-1.
Opinions?
Regards,
Stefan
[Attachment #5 (application/pgp-signature)]
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic