was unhelpful because 0.05 is not a fraction involving a power of 2.
On Friday, August 20, 2021, 03:15:42 p.m. EDT, 'Pascal Jasmin' via Programming <programm...@jsoftware.com> wrote: sorry in advance if this is unhelpful, but wouldn't any fraction of a power of 2 provide a "perfect conversion" to and from floating point? On Friday, August 20, 2021, 11:28:11 a.m. EDT, Henry Rich <henryhr...@gmail.com> wrote: 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.landh...@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.br...@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 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm