Alex Rufon wrote:
> I've encountered a problem with ~. 
> 
> Normally, if I do this it works:
> 
>    ~. 1 1.00000057 1
> 
> 1 1.00000057
> 
> Then, this morning, a bug was reported in our Cebu factory for a length
> error. It took me a while then I realize that the problem was this:
> 
>    ~. 20080516 20080516 20080516.00000057
> 
> 20080516
> 
> The code actually calculates how the daily WIP or how many items are
> going to be produced by a certain factory line given a start and end
> date-time. Hence the code is failing because it expects two values and
> is only getting one.
> 
> Since this is critical for me, I had to replace that very simple code
> with this:
> 
>    ".&>~.":&.><&> 20080516 20080516 20080516.00000057
> 
> 20080516 20080516.00000057
> 
> Is this a bug? I've read the documentation and it says that the
> comparison is tolerant. Is there an intolerant comparison much like the
> intolerant index of (i.!.0)?

I think you are unwise to work with such data, since it relies on about
17 decimal digits being precisely handled.

You should be able to improve this. For example, there is no need to use
the millenium in current dates. Also, the large number of zeroes in the
decimal part are presumably also not needed. Perhaps a format like the
following would be better:

   80516.0057

Incidentally, this is a programming forum question, not general.

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to