View Issue Details

IDProjectCategoryView StatusLast Update
0000942MetaPostbugpublic2015-08-03 09:28
Reportertoby Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version1.890 
Summary0000942: Simple numeric comparison fails with "binary" and "decimal" numersystems
DescriptionConsider this program:

    show 0.0001 < 0.001, numbersystem, mpversion; end.

With the default number system this gives

>> true
>> "scaled"
>> "1.999" )

on my log. But with the other number systems I get:

>> true
>> "double"
>> "1.999" )

>> false
>> "binary"
>> "1.999" )

>> false
>> "decimal"
>> "1.999" )

which is a bit unexpected...

I'm using a version I compiled myself from source after you fixed the normaldeviate bug a couple of months ago.
Steps To ReproduceRun

 show 0.0001 < 0.001, numbersystem, mpversion; end.

with the 4 different number systems.
TagsNo tags attached.

Activities

toby

2015-07-27 19:57

reporter   ~0001389

Testing with V1.902 (the only other version I have on hand, I only get the error with "decimal". But it does not appear to matter what numbers I use (ie same bug with 1<2, or 1/4<1/2, etc

This is MetaPost, version 1.902 (TeX Live 2014) (kpathsea version 6.2.0)
>> true
>> "scaled" )
This is MetaPost, version 1.902 (TeX Live 2014) (kpathsea version 6.2.0)
>> true
>> "double" )
This is MetaPost, version 1.902 (TeX Live 2014) (kpathsea version 6.2.0)
>> true
>> "binary" )
This is MetaPost, version 1.902 (TeX Live 2014) (kpathsea version 6.2.0)
>> false
>> "decimal" )

luigi scarso

2015-07-30 10:53

manager   ~0001390

It should be fixed in trunk.

toby

2015-08-02 22:51

reporter   ~0001391

Thanks - looks good from here. Can you share any details about where the bug was?

luigi scarso

2015-08-03 09:28

manager   ~0001392

IIRC, it should be a patch from Akira. See
"better patch for to_boolean for decimal and binary number system (A. Kakuto)"
in the svn repo.

Issue History

Date Modified Username Field Change
2015-07-27 01:03 toby New Issue
2015-07-27 19:57 toby Note Added: 0001389
2015-07-30 10:53 luigi scarso Note Added: 0001390
2015-08-02 22:51 toby Note Added: 0001391
2015-08-03 09:28 luigi scarso Note Added: 0001392