#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::TAOCP Vol 2::4.5.1 Fractions
#columns:Front	Back	Tags
TAOCP §4.5.1 Fractions: what does it cover?	Exact rational arithmetic: keeping fractions in lowest terms with gcds, doing add and multiply so intermediate numbers stay small, and fixed-slash and floating-slash representations that store a fraction in a fixed number of bits.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::about
TAOCP §4.5.1: why does it matter?	Rationals are used in computer algebra, geometry kernels and anywhere floats are not exact enough.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::why
TAOCP §4.5.1: what traps should you watch for?	<ul><li>Reducing only at the end and overflowing in the middle.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::traps
TAOCP §4.5.1, exercise 1 (rated 15): what is it asking?	Compare two fractions without overflow.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::exercise
TAOCP §4.5.1, exercise 5 (rated 10): what is it asking?	Add two fractions with the text's method.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::exercise
TAOCP §4.5.1, exercise 2 (rated M15): what is it asking?	Dividing out the gcd leaves coprime parts.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::exercise
TAOCP §4.5.1, exercise 6 (rated M23, recommended): what is it asking?	The gcd fact behind the efficient addition method.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::exercise
TAOCP §4.5.1, exercise 8 (rated 22, recommended): what is it asking?	Use 1/0 and -1/0 as infinities or overflow markers.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::exercise
TAOCP §4.5.1, exercise 7 (rated M22): what is it asking?	How large intermediate values get in fraction addition. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::exercise
TAOCP §4.5.1: how many exercises, and how are they rated?	16 exercises, rated 10 to 42.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::exercises
TAOCP §4.5.1: what should you be comfortable with first?	<ul><li>4.5.2 GCD idea from 1.1</li><li>4.3.1 Classical Algorithms</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::prereqs
TAOCP §4.5.1: how should you work through it?	Implement a Rational type with add and multiply that reduces cleverly using gcds of partial terms, as the section suggests, and test it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::approach
