| Server IP : 3.111.61.48 / Your IP : 216.73.216.67 Web Server : Apache System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.2.31 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3.10/test/__pycache__/ |
Upload File : |
o
�9j�8 � @ sl d Z ddlZddlmZmZmZ ddlmZ dd� Zdd� Z d d
� Z
dd� ZG d
d� de�Z
G dd� dej�ZG dd� d�Zdd� ZG dd� de�ZG dd� deed�ZG dd� de�ZG dd� de�Ze�e� G dd� dej�ZG d d!� d!e�ZG d"d#� d#e�ZG d$d%� d%e�ZG d&d'� d'e�ZG d(d)� d)e�ZG d*d+� d+�ZG d,d-� d-ej�Zed.kr�e� � dS dS )/z9Tests for binary operators on subtypes of built-in types.� N)�eq�le�ne)�ABCMetac C s | r|| | } }| s|S )z1Greatest common divisor using Euclid's algorithm.� )�a�br r �&/usr/lib/python3.10/test/test_binop.py�gcd s �r
c C �
t | t�S )z-Test whether an object is an instance of int.)�
isinstance�int��xr r r �isint
�
r c C s$ t ttfD ]
}t| |�r dS qdS )zATest whether an object is an instance of a built-in numeric type.� r )r
�float�complexr )r �Tr r r �isnum s
�r c C r )z7Test whether an object is an instance of the Rat class.)r �Ratr r r r �isRat r r c @ s� e Zd ZdZddgZd/dd�Zdd � Zeed
�Zdd� Z ee d
�Z
d
d� Zdd� Zdd� Z
dd� Zdd� ZeZdd� Zdd� Zdd� ZeZdd� Zdd � Zd!d"� Zd#d$� Zd%d&� Zd'd(� Zd)d*� Zd+d,� Zd-d.� Zd
S )0r z9Rational number implemented as a normalized pair of ints.� _Rat__num� _Rat__denr r c C sb t |�s
td| ��t |�std| ��|dkrtd��t||�}t|| �| _t|| �| _dS )z[Constructor: Rat([num[, den]]).
The arguments must be ints, and default to (0, 1).zRat numerator must be int (%r)z Rat denominator must be int (%r)r zzero denominatorN)r � TypeError�ZeroDivisionErrorr
r
r r )�self�num�den�gr r r �__init__"