Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

LongLong datatype not handling large numbers

163 views
Skip to first unread message

Bob Chauvin

unread,
May 25, 2004, 10:35:19 AM5/25/04
to
LongLong lll_Test
lll_Test = 19535032 * 4096
lll_Test is now = -1588887552 ???

Am I using the wrong data type? Found this, trying to get free disk space
on a large drive.
--
PB9.01.7096

Thank you,

R.Chauvin


Paul Horan[TeamSybase]

unread,
May 25, 2004, 10:44:32 AM5/25/04
to
"Bob Chauvin" <nocanspambob_chauvin@yahoo> wrote in message news:40b359a7@forums-1-dub...


I'll bet it's implicitly converting to integer because of the datatype of the multiplicands.

Try this:
uLong l1=19535032
uLong l2=4096
LongLong lll_test

lll_test = l1 * l2

--
Paul Horan[TeamSybase]


Bob Chauvin

unread,
May 25, 2004, 10:46:20 AM5/25/04
to
So, all elements must be longlong for a longlong to be returned?

"Paul Horan[TeamSybase]" <paulhATvcisolutionsDOTcom> wrote in message
news:40b35bf2$1@forums-2-dub...

davespeight

unread,
May 25, 2004, 10:52:23 AM5/25/04
to
A Bit Naff!

But this works! Must be a buffer problem or something!

LongLong lll_Test
lll_Test = 19535032 * 409.6 * 10

Bob Chauvin

unread,
May 25, 2004, 10:54:24 AM5/25/04
to
Created new longlong's for local vars in the calc, and now works. Thanks
Paul.

"Paul Horan[TeamSybase]" <paulhATvcisolutionsDOTcom> wrote in message
news:40b35bf2$1@forums-2-dub...

davespeight

unread,
May 25, 2004, 10:55:34 AM5/25/04
to
I agree with Paul....

This also works... (Just by adding a decimal point), so must
conclude it is doing some internal conversions

LongLong lll_Test
lll_Test = 19535032 * 4096.

mason

unread,
May 25, 2004, 11:21:22 AM5/25/04
to
Be careful with this syntax, you may lose precision if the numbers are big
enough. PB must use double data type when it sees a decimal point.

Using longlong() function to cast numeric number to longlong data type may
be more reliable.


<dave speight> wrote in message news:40b35e88.18a...@sybase.com...

Paul Horan[TeamSybase]

unread,
May 25, 2004, 12:08:14 PM5/25/04
to
"Bob Chauvin" <nocanspambob_chauvin@yahoo> wrote in message news:40b35e20$1@forums-1-dub...

> Created new longlong's for local vars in the calc, and now works. Thanks
> Paul.
>


Notice that my local variables weren't "longlong", they were unsignedLong. That's a "uLong" type.

--
Paul Horan[TeamSybase]


0 new messages