Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Bugs > Re: BUG #4114: ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 3 Topic 3715 of 4088
Post > Topic >>

Re: BUG #4114: Inconsistent ****ft operator

by Zdenek.Kotala@[EMAIL PROTECTED] (Zdenek Kotala) Apr 20, 2008 at 08:17 PM

Roman Kononov napsal(a):
> The following bug has been logged online:
> 
> Bug reference:      4114
> Logged by:          Roman Kononov
> Email address:      kononov@[EMAIL PROTECTED]
> PostgreSQL version: 8.3.1
> Operating system:   x86_64 GNU/Linux
> Description:        Inconsistent ****ft operator
> Details: 
> 
> The below test cases show the obvious inconsistency between different
> integer types.
> 
> test=# \t
> Showing only tuples.
> test=# select 1::int2 << 17;
>          0
> 
> test=# select 1::int4 << 33;
>          2
> 
> test=# select 1::int8 << 65;
>          2
> 
> test=# select 2::int2 >> 17;
>          0
> 
> test=# select 2::int4 >> 33;
>          1
> 
> test=# select 2::int8 >> 65;
>          1

It seems to be OK regarding how C ****ft operator works. Try

#include <stdio.h>
#include <inttypes.h>

void fce(int16_t arg1, int32_t arg2)
{
         int16_t res = arg1 << arg2;
         printf("result: %i\n", res);
}

int main()
{
         fce(1,17);
         return 0;
}



		Zdenek

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
 




 3 Posts in Topic:
BUG #4114: Inconsistent shift operator
kononov@[EMAIL PROTECTED]  2008-04-19 06:36:16 
Re: BUG #4114: Inconsistent shift operator
Zdenek.Kotala@[EMAIL PROT  2008-04-20 20:17:50 
Re: BUG #4114: Inconsistent shift operator
sam@[EMAIL PROTECTED] (S  2008-04-20 20:02:53 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 10:00:33 CDT 2008.