On Tue, Jul 06, 2010 at 09:45:50PM -0400, Pavel Ivanov scratched on the wall:

> Leading zeros in the number can never be significant,

  While that's true for SQL values, it isn't true in the general case.
  C programmers and old-school UNIX folks tend to get very nervous
  about leading zeros.  Consider:
  
    int main( ) { printf( "%d\n", 0123 ); }

  (hint: it prints "83").  Unless you know the application that is
  processing your input values very well, it pays not to make too many
  assumptions.

  For example, do you know the value of "i" and "d" in these statements?
  Without looking at the docs?  Do you think most programmers do?
  Do you think they usually get it "right" ?

  int i, d;
  sscanf( "0123", "%i", &i );
  sscanf( "0123", "%d", &d );

   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to