Couldn't the 57 be coming from a computation in floating point? The integer part of the number fits in 34 bits which leaves quite a few bits to represent the fractional part in 64 bit floating point. As long as the fractional part of the day is expressed as powers of 1/2 the floating point representation should still be exact; however, if any other fractional part of a day is entered it will not be represented exactly in floating point. As every programmer knows but often forgets to watch out for, 0.1 cannot be represented exactly in floating point.
On Tue, Apr 29, 2008 at 11:36 PM, Chris Burke <[EMAIL PROTECTED]> wrote: > Alex Rufon wrote: > > Unfortunately, the use of the 200801010000 as 01/01/2008 00:00 is > > tightly embedded into our system that yanking it out is no mean feat. :( > > OK, but this is not the same thing. The number you used was > 20080516.00000057 . Where does the 57 come from? > > Even if you cannot control the inputs, you should be able to fix up what > you are given so that things work properly in J. > > For example: > > ff=: ":!.15 > > NB. this is your problem: > ff ~. 20080516 20080516.00000057 > 20080516 > > NB. this is a simple fix that removes the millenium - > NB. you can always add it back later: > ff ~. 20080516 20080516.00000057 - 20000000 > 80516 80516.00000057 > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
