polyml 5.5.2-4

James Clarke jrtc27 at jrtc27.com
Mon Jan 25 09:18:09 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…

That’s my guess. The test suite wasn’t run before I took over (I feared I had stopped it running when I changed debian/rules to modern debhelper) either, so who knows how long it’s been there.

> 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 ;) )

It’s armhf, though you can use an armel pbuilder on top of that, no? The armel buildd used has Machine Architecture: armhf.

> anyway, my first build was on qemu pbuilder-dist, and I'm running right now two builds.

Thanks to your pbuilderrc fix I’m running a build myself, although it’s going to take a while...

> 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

1/3 can’t be represented exactly, so when rounding to +Inf, you get a little bit more than 1/3. 3 can be represented exactly, so 3 * 1/3 is a little more than 1, and since the rounding mode is set to +Inf it should therefore round to a little over 1. I’m pretty sure the test is correct; certainly it works on every other supported platform.

> 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

I’m not sure what you mean?

Regards,
James

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.alioth.debian.org/pipermail/debian-science-maintainers/attachments/20160125/9535451b/attachment.sig>


More information about the debian-science-maintainers mailing list