3 u: integer should give domain error. Fixed for next beta.
Henry Rich
On 5/10/2021 1:04 PM, greg heil wrote:
bi =: 3&u: NB. lit to int
same=: [
s =: '.1' { ~ [: #: bi NB. bitstrings of y's
s '2 3'
11..1.
1.....
11..11
s 2 3
1.
..
NB. Whoops, work around. Where
bq =: (2=3!:0) NB. byte?
bii =: 3 : '(>same`bi {~ bq y)~ y' NB. bytes to ints
si=: '.1' { ~ [: #: bii
si '2 3'
11..1.
1.....
11..11
si 2 3
1.
11
NB. Good!
By nuvoc
https://code.jsoftware.com/wiki/Vocabulary/uco
i should only expect y's of
byte or unicode in bi
so the fact that
s did not work
and i had to make
the work around's
of bq, bii, and si
is not surprising
But i would have expected
an error to be thrown?
using bi rather than bii
(aside from being much more succinct)
leads to some unexpected behavior
|: s i.9
........1
....1.1..
..1...1..
but i have not
figured out unicode
either, oh well
here is our yearly animalcule
[ox=: 7 u: 128046
i would like to get
bitwise representations
of all J's entities
but, an inauspicious start
~greg heil
https//picsrp.github.io
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
--
This email has been checked for viruses by AVG.
https://www.avg.com
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm