Strange results with ⍕ function

If we don't know about 'em, we can't fix 'em.

Strange results with ⍕ function

PostPosted by ppetro » Tue Mar 07, 2017 7:21 pm

d
0.0008106770673 ¯0.08018112821 0.07991359757
12 2⍕d
8.1E¯4 ¯0.00 0.00 ERROR!
12 2⍕10×d
8.1E¯3 ¯0.80 0.80 GOOD!
12 3⍕d
8.11E¯4 ¯0.080 0.079 GOOD!
⎕SYSVER
0.5.1.43 Mon Mar 06 18:29:32 2017 Win/64
ppetro
 
Posts: 10
Joined: Fri Sep 05, 2014 6:52 pm

Re: Strange results with ⍕ function

PostPosted by forummaster » Wed Mar 08, 2017 12:52 pm

ppetro wrote:d
0.0008106770673 ¯0.08018112821 0.07991359757
12 2⍕d
8.1E¯4 ¯0.00 0.00 ERROR!
12 2⍕10×d
8.1E¯3 ¯0.80 0.80 GOOD!
12 3⍕d
8.11E¯4 ¯0.080 0.079 GOOD!
⎕SYSVER
0.5.1.43 Mon Mar 06 18:29:32 2017 Win/64

Thanks for the bug report. The correct output for the first display is

0.00 ¯0.08 0.08

This is now fixed in the latest Alpha version:

http://www.nars2000.org/download/binaries/alpha/

BTW, I had trouble reproducing your output until I realized that the variable d was a VFP number. Very tricky!
forummaster
 
Posts: 554
Joined: Wed Jan 23, 2013 1:00 pm

Re: Strange results with ⍕ function

PostPosted by ppetro » Wed Mar 08, 2017 9:02 pm

The array d comes from some calculus involving trigonometric functions. I have not used vfp numers, or it is an effect of using trigonometric funtions? The problem was with values as 0.08 or 0.02, that were replaced by 0.00 when applyng
12 2⍕d, Now it seems corrected,
Thanks for your quick correction.
ppetro
 
Posts: 10
Joined: Fri Sep 05, 2014 6:52 pm

Re: Strange results with ⍕ function

PostPosted by forummaster » Fri Mar 10, 2017 7:28 am

ppetro wrote:The array d comes from some calculus involving trigonometric functions. I have not used vfp numers, or it is an effect of using trigonometric funtions? The problem was with values as 0.08 or 0.02, that were replaced by 0.00 when applyng
12 2⍕d, Now it seems corrected,
Thanks for your quick correction.

VFP numbers may be created by computing with VFP constants or by computing irrational functions (e.g., trig functions) on rational numbers which then produces VFP results. If your input is fixed precision numbers (integers and floats) only, then you should never see a VFP number.
forummaster
 
Posts: 554
Joined: Wed Jan 23, 2013 1:00 pm

Re: Strange results with ⍕ function

PostPosted by ppetro » Sun Mar 12, 2017 4:47 pm

I discovered while I've been obtaining VFP numbers.
I used a constant R←○÷180 to convert between degrees and radians, but founding other ways of defining ir I proved 1r180p1 which gives VFP numbers!
All these resulted in more knowledge for me in NARS2000 APL and hope it didn' cause you much work.
Thanks
ppetro
 
Posts: 10
Joined: Fri Sep 05, 2014 6:52 pm

Re: Strange results with ⍕ function

PostPosted by ppetro » Sun Mar 12, 2017 4:49 pm

I see I made an error saying "I prove... " instead of "I tried". In Spanish 'probar' puede ser prove or try..
ppetro
 
Posts: 10
Joined: Fri Sep 05, 2014 6:52 pm

Re: Strange results with ⍕ function

PostPosted by forummaster » Tue Mar 14, 2017 1:47 pm

ppetro wrote:I discovered while I've been obtaining VFP numbers.
I used a constant R←○÷180 to convert between degrees and radians, but founding other ways of defining ir I proved 1r180p1 which gives VFP numbers!
All these resulted in more knowledge for me in NARS2000 APL and hope it didn' cause you much work.
Thanks

No problem. I am counting on you to keep me honest. Keep up the good work!
forummaster
 
Posts: 554
Joined: Wed Jan 23, 2013 1:00 pm


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 3 guests

cron