[Curious] Integer division => fraction

Oca Emilio eoca at afip.gov.ar
Fri Jun 13 16:07:43 UTC 2003


> Point creation and accessing don't mind Fractions.
> Point arithmetic doesn't mind Fractions.
> Point truncation and rounding doesn't mind Fractions.
> Point comparison doesn't mind Fractions.
> Point converting doesn't mind Fractions.
> Point copying doesn't mind Fractions.
> Point polar coordinates doesn't mind Fractions.
> Point printing doesn't mind Fractions.
I have been using all this for a while without any (mayor) problem.
 
A minor problem for me was to deduce visually where I would place a couple
of points in a Cartesian plane. It's hard with 4-5 digit fraction
components.

> (Why is there no Point>>roundTo: ?)
When drawing in a canvas I use #asIntegerPoint.


Something that caused me some annoyance is:
(Point r: 100 degrees: 30) x = (Point r: 100 degrees: (180-30) )negated x 
	=> true

(Point r: 100 degrees: 60) y = (Point r: 100 degrees: (180-60) ) y
	=> false

	Emilio



More information about the Squeak-dev mailing list