MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000948MetaPostbugpublic2015-10-13 22:472017-05-18 13:54
Reporterlinus 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000948: mfplain.mp defines a wrong round function
DescriptionThe last mfplain.mp version that I could find (% $Id: mfplain.mp,v 1.9 2005/04/28 06:45:21 taco Exp $) defines:

vardef round primary u = u enddef;
vardef hround primary x = x enddef;
vardef vround primary y = y enddef;

But this should probably be (according to the METAFONTbook):

vardef round primary u =
 if numeric u: floor(u+.5)
 elseif pair u: (hround xpart u, vround ypart u)
 else: u fi enddef;
vardef hround primary x = floor(x+.5) enddef;
vardef vround primary y = floor(y.o_+.5)_o_ enddef;



Steps To Reproducempost '&mfplain \mode:=localfont; input font'

where font.mf contains the following line:

message decimal(round(4.2));

This will output 4.2 instead of 4
Additional InformationTaco Hoekwater had probably his reasons to do so. Probably one should ask him before changing mfplain.mp.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0001422)
luigi scarso (manager)
2015-10-15 08:59

Thank you very much. I will see asap.
(0001673)
luigi scarso (manager)
2017-05-18 13:54

Taco says
"""
there is no rounding in mp because it is not needed
mf rounds because of the bitmap grid
at least that was JDH's take on it
"""
I will leave unmodified these functions, perhaps I cann add MFround etc.

- Issue History
Date Modified Username Field Change
2015-10-13 22:47 linus New Issue
2015-10-15 08:59 luigi scarso Note Added: 0001422
2017-05-18 13:54 luigi scarso Note Added: 0001673


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker