loose extended precision

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

loose extended precision

PostPosted by drab » Mon Apr 03, 2017 6:20 am

This works fine

⎕fpc←256
x←2.1v
3 ⎕dr x
256


But it doesn't work if you do the same thing inside a function f.

f
⎕fpc←512
y←2.1v
3 ⎕dr y

f
256

And it doesn't matter whether or not ⎕fpc is local inside the function.
It doesn't work either way.
drab
 
Posts: 295
Joined: Thu Oct 09, 2014 6:23 am

Re: loose extended precision

PostPosted by forummaster » Mon Apr 03, 2017 10:00 am

drab wrote:This works fine
⎕fpc←256
x←2.1v
3 ⎕dr x
256

But it doesn't work if you do the same thing inside a function f.

f
⎕fpc←512
y←2.1v
3 ⎕dr y

f
256

And it doesn't matter whether or not ⎕fpc is local inside the function.
It doesn't work either way.

This is normal behavior for MPFR constants as they are currently defined; however because of behavior such as this that definition needs to change.

The precision of the constant 2.1v is set to the current value of ⎕FPC (256) when the function is fixed. Assigning to ⎕FPC inside the function does not change the precision of its constants. Note the difference if you assign ⎕FPC←512 and then fix the function.
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