ó ÄAic @ sª d Z d d l m Z d d l m Z d d l Z d d l Z d d l Z d d l Z d d g Z e j Z d „ Z e j d e j e j Bƒ Z d e f d „ ƒ YZ d S( s+ Rational, infinite-precision, real numbers.iÿÿÿÿ( t division( t DecimalNt Fractiont gcdc C s" x | r | | | } } q W| S( s¶ Calculate the Greatest Common Divisor of a and b. Unless b==0, the result will have the same sign as b (so that when b is divided by it, the result comes out positive). ( ( t at b( ( s! /usr/lib64/python2.7/fractions.pyR s sC \A\s* # optional whitespace at the start, then (?P
[-+]?) # an optional sign, then (?=\d|\.\d) # lookahead for digit or .digit (?P
\d*) # numerator (possibly empty) (?: # followed by (?:/(?P
\d+))? # an optional denominator | # or (?:\.(?P
\d*))? # an optional fractional part (?:E(?P
[-+]?\d+))? # and optional exponent ) \s*\Z # and optional whitespace to finish c B sß e Z d Z d' Z d d( d „ Z e d „ ƒ Z e d „ ƒ Z d d „ Z e d „ ƒ Z e d „ ƒ Z d „ Z d „ Z d „ Z d „ Z e e e j ƒ \ Z Z d „ Z e e e j ƒ \ Z Z d „ Z e e e j ƒ \ Z Z d „ Z e e e j ƒ \ Z Z e e e j! ƒ \ Z" Z# d „ Z$ d „ Z% d „ Z&