[metapost] Units unaccuracy with numbersystem set to double
Franck Pastor
franck.pastor at mac.com
Tue Apr 1 10:18:49 CEST 2014
Hello,
Since floating points numerics are available in MetaPost when setting the numbersystem variable to "double", I've used them regularly. Only recently I noticed something wrong with it: the MetaPost unit values are unchanged whether "numbersystem" is set to "double" or "scaled".
Here is a sample, for the centimeter (cm), millimeter(mm) and point (pt) units:
iMacIntel20-4:~ fp$ mpost -numbersystem=double
This is MetaPost, version 1.803 (kpathsea version 6.1.1)
**null
(mpost.mp (/usr/local/texlive/2013/texmf-dist/metapost/base/plain.mp
Preloading the plain mem file, version 1.005) )
(/usr/local/texlive/2013/texmf-dist/metapost/misc/null.mp)
*show cm;
>> 28.34645
*show mm;
>> 2.83464
*show pt;
>> 0.99626
*
Thus we've got exactly the same accuracy as with the scaled number system, whereas I had expected much more decimals. As an example, Asymptote, which uses floating-point arithmetics by default, returns this definition of the centimeter unit:
Welcome to Asymptote version 2.23 (to view the manual, type help)
> cm
28.3464566929134
>
Is MetaPost not supposed to have the same kind of accuracy when numbersystem is set to "double"?
NB: I'm still using the MetaPost version (1.803) that comes with TeX Live, not being able to install MetaPost 1.9 on my own. Maybe this problem has been solved in this last version.
Thanks for having read this!
Franck Pastor
More information about the metapost
mailing list