Tcl Source Code

Check-in [85e6dc0a02]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix regression in [expr {0%$bignum}].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-branch
Files: files | file ages | folders
SHA3-256: 85e6dc0a02464927f829ef63356ac20c5a227d69f42ca24d90616b586adeb9c2
User & Date: dgp 2018-02-14 14:38:15
Context
2018-02-14
20:17
Better range checking in "string index". Add test-case to prove point. check-in: 8a4df74e9a user: jan.nijtmans tags: core-8-branch
15:33
merge 8.7 Closed-Leaf check-in: 1a4479ca01 user: dgp tags: z_modifier
15:00
merge 8.7 check-in: d15df14b60 user: dgp tags: amg-string-insert
14:52
merge 8.7 check-in: 72b94c10f2 user: dgp tags: tip-445
14:50
merge 8.7 check-in: 5f3f2c02cb user: dgp tags: trunk
14:38
Fix regression in [expr {0%$bignum}]. check-in: 85e6dc0a02 user: dgp tags: core-8-branch
14:19
merge pyk-backport-to-8-6 check-in: c9251294d9 user: pooryorick tags: core-8-6-branch
12:52
More tests for bignum modulus regressions check-in: 98be5e06ea user: dgp tags: core-8-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclExecute.c.

8020
8021
8022
8023
8024
8025
8026








8027
8028
8029
8030
8031
8032
8033
		 */

		return constants[0];
	    }
	}
	if (type1 == TCL_NUMBER_WIDE) {
	    w1 = *((const Tcl_WideInt *)ptr1);








	    if (type2 != TCL_NUMBER_BIG) {
		Tcl_WideInt wQuotient, wRemainder;
		Tcl_GetWideIntFromObj(NULL, value2Ptr, &w2);
		wQuotient = w1 / w2;

		/*
		 * Force Tcl's integer division rules.







>
>
>
>
>
>
>
>







8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
		 */

		return constants[0];
	    }
	}
	if (type1 == TCL_NUMBER_WIDE) {
	    w1 = *((const Tcl_WideInt *)ptr1);

	    if (w1 == 0) {
		/*
		 * 0 % (non-zero) always yields remainder of 0.
		 */

		return constants[0];
	    }
	    if (type2 != TCL_NUMBER_BIG) {
		Tcl_WideInt wQuotient, wRemainder;
		Tcl_GetWideIntFromObj(NULL, value2Ptr, &w2);
		wQuotient = w1 / w2;

		/*
		 * Force Tcl's integer division rules.