2023-12-09 22:04 AEDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000342mercuryBugpublic2014-06-25 16:39
Assigned Tojuliensf 
Product Version 
Target VersionFixed in Version 
Summary0000342: string.format broken in non-C grades
DescriptionThe attached program should print "16.0"; when using the Mercury implementation of format
(i.e when using_sprintf returns false), it prints "10.0". This affects all of the non-C backends.
TagsNo tags attached.
Attached Files




juliensf (administrator)

This is derived from tests/general/float_test and appears to be the reason for the failure of that
test with non-C backends.


juliensf (administrator)

The strings above should be "16" and "10" respectively.


wangp (developer)

At least part of the bug can be attributed to commit b1af59cb29ac31db9fc5b3422fced505facabad1
where the replacement of string.substring was replaced by string.between incorrectly.


juliensf (administrator)

Yes, that commit introduced an off-by-one error at string.m:4038. Fixing that fixes the problem.
I'll commit a fix after I run some further tests to see if anything else is broken.


juliensf (administrator)

Fix committed.

-Issue History
Date Modified Username Field Change
2014-06-24 16:03 juliensf New Issue
2014-06-24 16:03 juliensf File Added: fmt_bug.m
2014-06-24 16:05 juliensf Note Added: 0000706
2014-06-24 16:14 juliensf Note Added: 0000707
2014-06-24 16:31 wangp Note Added: 0000708
2014-06-24 16:54 juliensf Note Added: 0000709
2014-06-25 16:39 juliensf Note Added: 0000710
2014-06-25 16:39 juliensf Status new => resolved
2014-06-25 16:39 juliensf Resolution open => fixed
2014-06-25 16:39 juliensf Assigned To => juliensf
+Issue History