[metapost] quick question

luigi scarso luigi.scarso at gmail.com
Fri Dec 16 08:46:15 CET 2016


On Fri, Dec 16, 2016 at 6:44 AM, Walt Burkhard <burkhard at cs.ucsd.edu> wrote:
> I seem to recall a command option for mpost that utilizes greater precision.
>
> Could someone remind me what this option is --- or even better, where is it
> documented.
>
> Many thanks in advance.
>
> Walt Burkhard
>
> --
> http://tug.org/metapost/

# cat z3.mp
numberprecision:=1000;
l:= 2* (sind(45)*sind(45)) ;
message "2(sin(pi/4))^2=" & decimal(l);
end

# mpost --numbersystem=binary z3.mp


2(sin(pi/4))^2=0.99999999999999999999999999999999999999999999999999999999999999
9999999999999995500685982587328941466008925956743358846676453077695224708884137
3202959357594412748579486490307394472201776885255225348090177855945121670332769
3576217588312178897284943578694920653116173110719489539702919056158075667128317
1013098769571557102436467101192475775943350166047699098570842399296329300847262
8796350793581979915791836991238024542773653253432517395260425334030683649674151
1401463742823286653691721135116386681462119702828929595726125383556460165893303
1581635900652986291636398813835109102803238325463630762575092312798114990823777
9210644199211064108314930545421975076873095973718106656490289946969213231470283
4451576048969364651521740690440214865405152923859142196626335762315317261224033
8070992383004295142905930062240550218370875929818148874789368369823122667897921
8682148869566993795514890340693440418571508070878239798282017794883918125183567
9793057957316429238735625597219884586998890005318742265047819663122725

"binary" is mpfr, see
http://www.mpfr.org/mpfr-current/mpfr.html
-- 
luigi


More information about the metapost mailing list