polyml 5.5.2-4
Gianfranco Costamagna
costamagnagianfranco at yahoo.it
Mon Jan 25 09:01:48 UTC 2016
Hi,
>Meant to say: I have one, though it’s running raspbian; would that mess with things?
not sure, I'm pretty sure the bug has always been there, just hidden because of a missing
testsuite run...
and you don't have too much dependencies on your package, so probably you will hit the bug
on raspbian too (BTW do you have an armel raspbian? I thought nobody was still using armel,
and everybody was on armhf for raspberrypi now ;) )
anyway, my first build was on qemu pbuilder-dist, and I'm running right now two builds.
one locally, and one in a porterbox
./poly < Tests/Succeed/Test121.ML
Poly/ML 5.5.2 Release
val check = fn: bool -> unit
exception Unordered
type decimal_approx =
{class: float_class, digits: int list, exp: int, sign: bool}
datatype float_class = INF | NAN | NORMAL | SUBNORMAL | ZERO
val fromString = fn: string -> decimal_approx option
val getRoundingMode = fn: unit -> rounding_mode
datatype real_order = EQUAL | GREATER | LESS | UNORDERED
datatype rounding_mode = TO_NEAREST | TO_NEGINF | TO_POSINF | TO_ZERO
val scan = fn:
(char, 'a) StringCvt.reader -> (decimal_approx, 'a) StringCvt.reader
val setRoundingMode = fn: rounding_mode -> unit
val toString = fn: decimal_approx -> string
val it = (): unit
val it = (): unit
val pos = 0.3333333333: real
Exception- Fail "Wrong" raised
val neg = ~0.3333333333: real
Exception- Fail "Wrong" raised
val it = (): unit
val it = (): unit
val pos = 0.3333333333: real
Exception- Fail "Wrong" raised
val neg = ~0.3333333333: real
Exception- Fail "Wrong" raised
val it = (): unit
val it = (): unit
val pos = 0.3333333333: real
Exception- Fail "Wrong" raised
val neg = ~0.3333333333: real
Exception- Fail "Wrong" raised
val it = (): unit
val it = (): unit
val it = (): unit
val pos = 0.3333333333: real
val neg = ~0.3333333333: real
val it = (): unit
I quickly looked at the test
setRoundingMode(TO_POSINF);
check(getRoundingMode() = TO_POSINF);
val pos = 1.0/3.0;
check(pos * 3.0 > 1.0);
val neg = ~1.0/3.0;
check(neg * 3.0 > ~1.0);
well, I'm not sure the test is correct, I mean, you might have the exact 1.0 value too
setRoundingMode(TO_POSINF);
check(getRoundingMode() = TO_POSINF);
val pos = 1.0/3.0;
check(pos * 3.0 >= 1.0);
val neg = ~1.0/3.0;
check(neg * 3.0 >= ~1.0);
seems to be more appropriate to me (replace > with >=)
not sure if with Real numbers this is something that can happen
(I mean this kind of rounding), but seems to be fixing the issue.
I can upload the fix, if you give me a dsc file :)
(note: I'm not sure this change is sane, I don't understand polyml language, so probably
you might have a better point of view than me).
BTW, what about overriding dh_auto_test to print the command you gave me in case of failure?
something like
override_dh_auto_test:
dh_auto_test || do something in case of failure, e.g. loop and print tests || exit 1
not sure if it works, needs to be tested :)
cheers,
G.
More information about the debian-science-maintainers
mailing list