0
Fertiggestellt

'OverrideDoubleBasicArrays' option and 'double' method

john doe vor 9 Jahren aktualisiert von Pavel Holoborodko vor 9 Jahren 1

Reason why someone would activate the option "OverrideDoubleBasicArrays" is to work with the desired precision (superior to that offered by type "double").


On the other hand, in "classic" Matlab, no one uses the builtin function "double" with explicit intentionality to reduce the precision for data (most often on the contrary).

In order to shoot not themselves in the foot I suggest altering the method "double" like this:


if ~(mp.OverrideDoubleBasicArrays && ismp(x))
r = mpimpl(402,x); else r = x; end


Fertiggestellt

@"On the other hand, in "classic" Matlab, no one uses the builtin function "double" with explicit intentionality to reduce the precision for data"


This is very true. However, in case of multiprecision, user needs double() for reducing precision in many cases.

For example, for plotting, or for passing mp-arrays to internal MATLAB's MEX modules (as we did for ip = triperm('H',double(a));)


My idea is to overload all implicit floating-point functionality.

But, user should have possibility to switch to double, by using explicit conversion function.