Bo said:
v=(<.v)+(1|v) NB. number = integer part + fractional part? Yes!

True. However, if
      ]v=:2%(3r19-%1 2 3 245 246 247 248)
_2.375 _5.84615 _11.4 13.0028 13.0014 13 12.9986

And we define the fractional part of v your way:

    1|v

0.625 0.153846 0.6 0.0027933 0.00139082 0 0.998621

I contend that 0.0625 is NOT the fractional part of _2.375, at least not in
my eyes. It may be the residue of a division by one, but that isn't what I
call a fractional part of a negative number (except maybe in 2s complement
binary)

Also, using your definition of the integer part:

     ]v=:2%(3r19-%1 2 3 245 246 247 248)
_2.375 _5.84615 _11.4 13.0028 13.0014 13 12.9986

      <. v

_3 _6 _12 13 13 13 12

_3 _6 _12 isn't the integer part of  _2.375 _5.84615 _11.4

However, as you say:

     v=(<.v)+(1|v)

1 1 1 1 1 1 1

So my test for finding the correct fractional and integer parts of a number
by adding the two parts together are not sufficient to determine if the ip
and fp are the correct values.


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

Reply via email to