Even if the numbers are divisible by 2, they themselves may also floating point numbers.
On Fri, 16 Jun 2023 at 9:55 PM 'Veter Kamenev' via General < gene...@jsoftware.com> wrote: > Hi! > > In many cases -: verb uses when number is divisible by 2. > > 3!:0 +: 2 > 4 (integer) > > Surprise for me > > 3!:0 -: 2 > 8 (float) > > My wish is to do a low bit check and use a shift to get an integer in the > result. > > Perhaps it makes sense to do this for the usual division by 2 (number % 2). > > In general, ideally, the result of any division should be an integer if > the numbers are divisible. > But I understand what it means that in many cases you will have to do a > check, > which will slow down the calculations. > > In this regard, I would like to have a separate verb for integer division > (%.. or %:: by example), > and not a verb <.@% that is calculated via float. > > Best wishes, > Veter Kamenev > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm