Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions samples/distro-examples/tests/all.bas
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,4 @@ print "VAL:" + VAL (s)
print "WEEKDAY:" + WEEKDAY(dmy) + " " + WEEKDAY(1,1,2020) + " " + WEEKDAY(JULIAN(d,m,y))
print "XPOS:" + XPOS
print "YPOS:" + YPOS
print "RoundPrecisionBug:"; 32.99999999999999
1 change: 1 addition & 0 deletions samples/distro-examples/tests/output/all.out
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,4 @@ VAL:0
WEEKDAY:-1 3 1
XPOS:0
YPOS:0
RoundPrecisionBug:33
2 changes: 1 addition & 1 deletion src/common/blib_math.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void mat_gauss_jordan(var_num_t *a, var_num_t *b, int n, double toler) {
indxr[i] = irow;
indxc[i] = icol;

if (a[icol * n + icol] < toler) {
if (fabs(a[icol * n + icol]) < toler) {
err_matsig();
free(indxc);
free(indxr);
Expand Down
2 changes: 1 addition & 1 deletion src/common/fmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void bestfta_p(var_num_t x, char *dest, var_num_t minx, var_num_t maxx) {
}
fpart = fround(frac(x), precision) * pow(10, precision);

if (fpart >= FMT_xRND) { // rounding bug
if (fpart >= pow(10, precision)) { // rounding bug, i.e: print 32.99999999999999 -> Output: 32.1
ipart = ipart + 1.0;
if (ipart >= maxx) {
ipart = ipart / 10.0;
Expand Down