Re: [sqlite] 8 byte integer not same as MSSQL bigint -- missing one value

2007-03-07 Thread drh
"Samuel R. Neff" <[EMAIL PROTECTED]> wrote:
> Just out of curiosity, why is the range for an 8 byte integer in SQLite one
> number off from the 8 byte bigint in MSSQL?
> 
> SQLite: -9223372036854775807 through 9223372036854775807
> MSSQL : -9223372036854775808 through 9223372036854775807
> 

It simplifies the routine that converts strings to integers
if the maximum negative value has the same set of digits as
the maximum positive value.

--
D. Richard Hipp  <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] 8 byte integer not same as MSSQL bigint -- missing one value

2007-03-07 Thread Samuel R. Neff

Just out of curiosity, why is the range for an 8 byte integer in SQLite one
number off from the 8 byte bigint in MSSQL?

SQLite: -9223372036854775807 through 9223372036854775807
MSSQL : -9223372036854775808 through 9223372036854775807

Values are from testing with SQLite 3.3.12 and MSSQL 2005.


SQLite:

create table x(i integer);
insert into x(i) values(-9223372036854775808);
insert into x(i) values(-9223372036854775807);
insert into x(i) values( 9223372036854775808);
insert into x(i) values( 9223372036854775807);
select i, typeof(i) from x;


MSSQL:

create table #x(i bigint);
insert into #x(i) select 9223372036854775809 * -1;
insert into #x(i) select 9223372036854775808 * -1;
insert into #x(i) select 9223372036854775808;
insert into #x(i) select 9223372036854775807;
select * from #x;


Thanks,

Sam


---
We're Hiring! Seeking a passionate developer to join our team building
products. Position is in the Washington D.C. metro area. If interested
contact [EMAIL PROTECTED]
 


-
To unsubscribe, send email to [EMAIL PROTECTED]
-