QIF Import fails out of CVS

Derek Atkins warlord@MIT.EDU
13 Feb 2001 18:30:39 -0500


grib@gnumatic.com (Bill Gribble) writes:

> Wait a minute... I looked at your patch again, and if I'm not mistaken
> it has the same problem as the original code: you can't ensure that
> both arguments to scm_logand are fixnums.  You can guarantee that they
> would fit within the RANGE of a fixnum, but that's depending on
> scm_ash to return a fixnum result for a bignum arg just because it
> "could" (i.e. the result would fit), and that's pretty
> dubious.. certainly not guaranteed.

So long as the original number fits in 64-bits, so it meets the
requirement that abs(num) <= 2^63, then yes, my code works properly.
This is because both arguments to scm_logand are guaranteed to fit in
the range 0 <= bits <= 0xFFFF, which _should_ be a fixnum.  At least,
in my tests this seems to work fine.

> Am I misinterpreting your patch?  I *am* very tired. 

Go get some sleep. ;)

FTR, I tried my algorithm in guile, by hand, and it worked fine, even
for a 60-bit number.  So, I'm relatively confident that it works.
I've used this particular algorithm (albeit in very different
circumstances) and it's always worked fine.  The wonders of MSB vs.
LSB processing :)

> b.g.

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available