Hahn, Harvey wrote:
>
> ]dj=. '239.43';'240.01';'238.14';'237.75'
>
> log10=: 10^.] NB. convenience definition
>
> ]djlog=. <items log10(".>dj)
>
> Everything's fine, except that the above are floating values rather than
> literals, as in the original market data table. So I attempted to use
> ": to do the conversion, placing it where I thought would be the correct
> position:
To convert your data to boxed literals the simplest/fastest way is probably to
use the foreign conjunction 8!:0
]djlog=. 8!:0 log10 (0".>dj)
+-----------+-----------+-----------+-----------+
|2.379178566|2.380229337|2.376832349|2.376120526|
+-----------+-----------+-----------+-----------+
datatype each djlog
+-------+-------+-------+-------+
|literal|literal|literal|literal|
+-------+-------+-------+-------+
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm