[Jprogramming] Is internal representation the problem? (again...)
Henry Rich
henryhrich at gmail.com
Fri Aug 20 15:28:03 UTC 2021
Perhaps I missed it, but I don't think you have presented evidence or
even testimony to the effect that (x ". y) is producing different
results on the same input string.
What I saw was a frequency chart that showed that '0.05' occurred many
times, and an execution of the line '+/ 0.05 = data' that came up with a
total of 0.
This is consistent with a file that contains many occurrences of
'0.0499999999' for example.
a =. 5 # 0.0499999999
~. a
0.05
#/.~ a
5
+/ 0.05=a
0
Henry Rich
On 8/20/2021 4:16 AM, Pablo Landherr wrote:
> Just noticed I wrote *do* wrong. I meant ".
>
> Why would ". convert the same repeated character string into different (on
> a bit level) numbers?
>
> On Thu, Aug 19, 2021 at 7:33 PM Pablo Landherr <pablo.landherr at gmail.com>
> wrote:
>
>> OK, I buy that. However, the origin of the data makes this dubious. The
>> data is imported as characters, so what I have is a bunch (thousands) of
>> '0.05' converted in one go by ":
>> Why would ": convert the same repeated character string of '0.05' into
>> different numbers on a bit level?
>>
>> Kr,
>> Pablo
>>
>> On Thu, Aug 19, 2021 at 7:13 PM Brian Schott <schott.brian at gmail.com>
>> wrote:
>>
>>> Try this?
>>>
>>> cf =: 3 : '(~.y),.#/.~y '
>>> imp =: -,+
>>> 0.05 imp 0.1*9!:18 ''
>>> 0.05 0.05
>>> ~. 0.05 imp 0.1*9!:18 ''
>>> 0.05 0.05
>>> cf 0.05 imp 0.1*9!:18 ''
>>> 0.05 1
>>> 0.05 1
>>>
>>>
>>>
>>> --
>>> (B=)
>>> ----------------------------------------------------------------------
>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>>
> ----------------------------------------------------------------------
> 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
More information about the Programming
mailing list