Re: [Jprogramming] calculus horibilis

2022-06-07 Thread Raul Miller
On Tue, Jun 7, 2022 at 3:57 PM Elijah Stone wrote: > I don't like trenchcoat functions, but _if_ one is to use b., the result is > much more comprehensible if the truth table is represented in base 2. I agree that 2b0110 b./~ 0 1 0 1 1 0 is more comprehensible than 6 b./~ 0 1 0 1 1 0 An

Re: [Jprogramming] calculus horibilis

2022-06-07 Thread Elijah Stone
On Tue, 7 Jun 2022, Devon McCormick wrote: Even in this case, unless the numbers are already written in J notation, I don't see how putting a "16b" or "8b" in front of each number is any simpler than simply doing base conversion. I don't like trenchcoat functions, but _if_ one is to use b., t

Re: [Jprogramming] calculus horibilis

2022-06-07 Thread Jan-Pieter Jacobs
I think the implementation is correct, though it lets you use numbers larger than the specified base, and always returns an integer in base 10: 4b5 NB. 5 > 4 but no problem 5 4bz 35 This is the same behaviour as #. : 4 #. 5 5 4 #. 1 1 5 when using base specification using b, J lets yo

Re: [Jprogramming] calculus horibilis

2022-06-07 Thread Raul Miller
On Tue, Jun 7, 2022 at 11:11 AM Devon McCormick wrote: > > The 'b' notation is useful when importing numbers which were > > originally supplied in non-base-10 format. (Hexadecimal, octal and > > binary are relatively common in some contexts.) > > Even in this case, unless the numbers are already w

Re: [Jprogramming] calculus horibilis

2022-06-07 Thread Devon McCormick
> The 'b' notation is useful when importing numbers which were > originally supplied in non-base-10 format. (Hexadecimal, octal and > binary are relatively common in some contexts.) Even in this case, unless the numbers are already written in J notation, I don't see how putting a "16b" or "8b" in

Re: [Jprogramming] calculus horibilis

2022-06-07 Thread Raul Miller
On Tue, Jun 7, 2022 at 10:49 AM Devon McCormick wrote: > In any case, I don't think I have ever found the "b" notation to be > particularly useful. The 'b' notation is useful when importing numbers which were originally supplied in non-base-10 format. (Hexadecimal, octal and binary are relatively

Re: [Jprogramming] calculus horibilis

2022-06-07 Thread Devon McCormick
Hi Yves, I'm not sure how you're interpreting J's base number notation but it is certainly correct in the examples you mention. For instance, 5 in base 4 is indeed 11 because 5=+/1 1*4^1 0 or "1" in the 1s column plus 1 in the 4s column equals 5. In fact this is exactly the same as substituting

Re: [Jprogramming] calculus horibilis

2022-06-07 Thread Raul Miller
On Tue, Jun 7, 2022 at 10:25 AM yt wrote: > J has other number notations that use letters: > ) > 3b102 NB. base (102 in base 3) > 11 > > my eyes are horrified by the result > > 11 in base 3 is > (1*3^1)+(1*3^0) > 4 The displayed result you got when you entered 3b102 wa

[Jprogramming] calculus horibilis

2022-06-07 Thread yt
Dear All, to start in J, i use labs. in this page, ── (23 of 35) Numbers (ctd) ─ Note the "e" notation used in 2.41785e24, meaning:   2.41785 * 10^24 J has other number notations that use letters: )    3b102 NB. base (102 in base 3) 11 my eyes