Hi Regina,

On Monday, 2011-01-17 23:12:16 +0100, Regina Henschel wrote:

> I'm currently looking in ScBinomDist to remove the PushNoValue()
> cases. I see a lot of ULONG there and as Carsten has announced, that
> ULONG will be removed, my question now, how I should replace it.
> The parameters n (total number of independent trials) and x (number
> of successful trials) are integers in ODF. As we store them in
> double, they are exact up to 48Bit. The code has some for-loops up
> to this parameters. What type shall I use for the index i in the
> loops?

Such loop variables were intentionally declared as ULONG to use the
maximum size integer a system provides, back in time when ULONG was
typedef'ed to unsigned long. On the other hand, I can hardly imagine
a spreadsheet where more than 2^32 cells are passed as a data range..

A safe approach would be to use sal_uInt32 and introduce a GetuInt32()
method (internally using GetDouble()) to obtain an argument that is to
be converted into a sal_uInt32 and let that set an error if the
approxFloor()'ed argument value is greater than SAL_MAX_UINT32. We may
introduce errNumericOverflow to signal this and distinguish from other


 OOo Calc core developer. Number formatter stricken i18n transpositionizer.
 Signature key 0x87F8D412 : 2F58 5236 DB02 F335 8304  7D6C 65C9 F9B5 87F8 D412
 OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS

Attachment: pgpVyS9CgMwHu.pgp
Description: PGP signature

Reply via email to