Jorrit Kirsten
unread,Jun 3, 2025, 5:46:33 AM6/3/25Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to forum
Hi everyone,
I have experienced unexpected behaviour when using makenum from tables/csv on boxed values and I assume it is a bug:
]data_0 =. '1-2' ; '1 - 2' ; 'ABC'
┌───┬─────┬───┐
│1-2│1 - 2│ABC│
└───┴─────┴───┘
NB. When applying makenum the first box (index 0) remains being a literal and the second becomes unexpectedly becomes a float.
NB. The '-' in the second box (index 1) is interpreted as _ (infinity), not even as minus:
]data_1 =. makenum data_0
┌───┬─────┬───┐
│1-2│1 _ 2│ABC│
└───┴─────┴───┘
(,: datatype&.>) data_1
┌───────┬────────┬───────┐
│1-2 │1 _ 2 │ABC │
├───────┼────────┼───────┤
│literal│floating│literal│
└───────┴────────┴───────┘
1{:: makenum '1-2' ; '1 - 2' ; 'ABC'
1 _ 2
NB. Aside: Note that 1 {:: data_1 has the type floating, since _ has floating type, which may be unexpected for users expecting that an integer type might also support infinity values, but this does not seem to be supported by (m)any (?) programming languages and there does not seem to be a standard for integer arithmetic like there is for floating point arithmetic (IEEE Standard for Floating-Point Arithmetic (IEEE 754)):
datatype _
floating
Jorrit