miscon:programming.types.integer-division-gives-fraction · draft · trust low · v0.1.1 · kind overgeneralization
Dividing two integers gives a fraction
Dividing one whole number by another gives the exact mathematical result with a fractional part, whatever the types involved.
- Stable URI
- https://open-misconceptions.github.io/miscon-data/m/programming.types.integer-division-gives-fraction
- UUID
f884573f-e177-4865-9cbb-e334397e406a- Domain
programming.types- Level band
- secondary, undergraduate
- Locale
- en
- About
- https://open-misconceptions.github.io/miscon-data/c/programming.types.integer-division (Miscon)
Evidence patterns
Pattern 0: predict the result of integer division in a language that truncates
predicts the exact quotient
int x = 7 / 2;
System.out.println(x);33.5Pattern 1: compute an average of integers
divides an int sum by an int count and expects a decimal average
int total = 7, n = 2;
double avg = total / n;3.0 (integer division happens first)3.5Discriminators
vs a slip. Consistent across items; the learner is surprised by 3 and cannot explain it. A slip is forgetting a cast once while knowing the rule.
Relations
conflicts_with- Dividing two integers gives an integer result (external)
resolved_by- Dividing two integers gives an integer result (external)
Provenance
Origin: llm-drafted
- Qian, Y., & Lehman, J. (2017). Students' misconceptions and other difficulties in introductory programming: A literature review. ACM Transactions on Computing Education, 18(1), Article 1. doi:10.1145/3077618
Integer division and type-related misconceptions in the review. - Sorva, J. (2012). Visual Program Simulation in Introductory Programming Education (Doctoral dissertation, Aalto University). Appendix A catalogues introductory programming misconceptions from the literature. link
Drafted from the cited literature for the Open Misconceptions seed pack; statement, examples and discriminators are original text. Awaiting maintainer review.
Review status
Status draft, trust low (computed from the reviews below against the reviewer registry).
No reviews yet.
Formats
- Raw JSON
- CASE 1.1 package (CFItem
f884573f-e177-4865-9cbb-e334397e406a) - Source on GitHub
Cite
miscon:programming.types.integer-division-gives-fraction
https://open-misconceptions.github.io/miscon-data/m/programming.types.integer-division-gives-fraction