Question

I need to work with precision in Dyalog APL. I know the value of ⎕PP sets the precision, but I can't increase it over 18, so I can't get more precision than 18 digits and I need to operate with big numbers. Is there any way to increase precision?

Was it helpful?

Solution

Version 13.0 of Dyalog APL, which is currently in Beta and scheduled for release at the end of March, allow users to decide whether to use the old IEEE-754 binary DOUBLE precision format, which has a maximum precision of 16 digits, or IEE-754-2008 128-bit Decimal floating-point numbers. The new format has 34 digits of precision and also avoids a number of rounding issues caused by the old binary format. Computations using the new format will be very significantly slower unless you are running APL on IBM POWER hardware, which has hardware support for the new format from the P6. Contact sales@dyalog.com if you would like to participate in the Beta program.

Version 13.0 also adds support for complex numbers in Dyalog APL - but only using a pair of binary double-precision numbers - there will be no decimal complex numbers for now.

We are working on support for unlimited-precision integers and rational numbers. A prototype of this may appear in 2011, but we don't expect to put it into a production release until 2012 at the earliest.

Morten Kromberg (CTO, Dyalog Ltd)

OTHER TIPS

Quad PP is for "print precision", and is relevant only for displaying numbers in the Dyalog APL session, and has nothing to do with the actual precision of numbers.

There is a supplied workspace named "dfns" that contains functions for operating with big numbers.

Just to follow up on Morten's reply, Dyalog APL has indeed supported 128-bit quad-precision decimal floating point since version 13.0 was released back in 2011! You can switch floating point format by setting a system variable ⎕FR to 645 (for double precision binary) or 1287 (for quad precision decimal). Try it online!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top