Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 bug: i. sequences should start from zero #3

Merged
merged 1 commit into from
Nov 6, 2023

Conversation

cratelyn
Copy link
Owner

@cratelyn cratelyn commented Nov 6, 2023

this fixes a small bug for the i. operator, which was generating sequences 1..n, rather than 0..n-1.

comparing with the official J runtime for reference:

; jconsole
   i. 0

   i. 5
0 1 2 3 4

   i. 5 5
 0  1  2  3  4
 5  6  7  8  9
10 11 12 13 14
15 16 17 18 19
20 21 22 23 24

; cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.10s
     Running `target/debug/j`
  i. 0

  i. 5
0 1 2 3 4

  i. 5 5
0 1 2 3 4
5 6 7 8 9
10 11 12 13 14
15 16 17 18 19
20 21 22 23 24

this fixes a small bug for the `i.` operator, which was generating
sequences `1..n`, rather than `0..n-1`.

comparing with the official J runtime for reference:

```
; jconsole
   i. 0

   i. 5
0 1 2 3 4

   i. 5 5
 0  1  2  3  4
 5  6  7  8  9
10 11 12 13 14
15 16 17 18 19
20 21 22 23 24

; cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.10s
     Running `target/debug/j`
  i. 0

  i. 5
0 1 2 3 4

  i. 5 5
0 1 2 3 4
5 6 7 8 9
10 11 12 13 14
15 16 17 18 19
20 21 22 23 24
```
@cratelyn cratelyn self-assigned this Nov 6, 2023
@cratelyn cratelyn merged commit 77da06c into main Nov 6, 2023
@cratelyn cratelyn added the example-pulls example pull requests referenced in README.md label Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
example-pulls example pull requests referenced in README.md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant