Sujet : format/2 doesn't agree with Trealla or SWI (Was: Is old school mode directed compilation dead?)
De : janburse (at) *nospam* fastmail.fm (Mild Shock)
Groupes : comp.lang.prologDate : 25. Jan 2025, 14:13:33
Autres entêtes
Message-ID : <vn2o1s$f81a$1@solani.org>
References : 1 2 3 4 5 6 7 8
User-Agent : Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0 SeaMonkey/2.53.20
Possibly it does round away from zero and not half-even:
/* Trealla Prolog 2.63.33 & SWI-Prolog 9.0.4 */
?- format('~0f ~0f', [1.5, 2.5]), nl.
2 2
/* Scryer Prolog 0.9.4-286 */
?- format("~0f ~0f", [1.5, 2.5]), nl.
1 2
Pitty there is no Prolog Improvement Proposals (PIP) for format/2.
https://prolog-lang.org/ImplementersForum/PIPs