http://qs321.pair.com?node_id=99531

Given two scalars that contain non-negative integer values, as ($numerator, $denominator). $denominator is non-zero as well.

Find the perl golf solution subroutine that returns the reduced fraction; that is, a fraction that is still equivalent to the initial fraction but using the smaller possible (non-negative!) integer values to make it up. The fraction is returned as an array in the order of (numerator, denominator).

Examples can include:
@a = reduce( 512, 1024 ); # @a = ( 1, 2 ) @a = reduce( 12, 18 ); # @a = ( 2, 3 ) @a = reduce( 1, 7 ); # @a = ( 1, 7 )
Thanks to tilly for the update.

-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain