관리-도구
편집 파일: test_half.cpython-37.pyc
B ��Fd�H � @ s� d dl mZmZmZ d dlZd dlZd dlmZmZm Z m Z d dlmZm Z mZmZmZ dd� ZG dd� de�Zed kr~e � dS ) � )�division�absolute_import�print_functionN)�uint16�float16�float32�float64)�TestCase�run_module_suite�assert_�assert_equal�decc O s` y|||� W n> t k rL } z tt|��| �dkd| � W d d }~X Y nX tdd| � d S )Nr z%Did not raise floating point %s errorF)�FloatingPointErrorr �str�find)Zstrmatch�callable�args�kwargs�exc� r ��/builddir/build/BUILDROOT/alt-python37-numpy-1.13.3-8.el8.x86_64/opt/alt/python37/lib64/python3.7/site-packages/numpy/core/tests/test_half.py�assert_raises_fpe s r c @ s� e Zd Zdd� Zdd� Zdd� Zdd� Zd d � Zdd� Zd d� Z dd� Z dd� Zdd� Zdd� Z e�e�� dkd�dd� �Zdd� ZdS )�TestHalfc C s� t jdtd�| _t| j_t j| jtd�| _t j| jt d�| _ t �t jdddtd�t jdddtd�f�| _t| j_t j| jtd�| _ t j| jt d�| _| jdd� | _| j dd� | _| jdd� | _d S ) Ni )�dtypei � i� ���r i| � )�np�aranger �all_f16r r �arrayr �all_f32r �all_f64�concatenate� nonan_f16Z nonan_f32Z nonan_f64� finite_f16� finite_f32� finite_f64)�selfr r r �setUp s zTestHalf.setUpc C s� t j| jtd�}t| jjtd�|jtd�� t j| jtd�}t| jjtd�|jtd�� t j| j t j d�}t j|td�}t| j jtd�|jtd�� t �dd�}t j|td�}t j|t jd�}t||� dS )z[Checks that all 16-bit values survive conversion to/from 32-bit and 64-bit float)r i ���i N) r r r r r r �viewr r! r# � longdoubler �int)r'