Current File : //usr/local/apps/python3/lib/python3.11/test/__pycache__/test_math.cpython-311.pyc |
�
�Ke}p � �� � d dl mZmZ d dlmZ d dlZd dlZd dlZd dlZd dl Z d dl
Z
d dlZd dlZd dl
Z
dZ ed� � Z ed� � Z ed� � Ze
j j Ze
j j Zd\ ZZeez d k Zed
k re
j d ZneZe j � e� � pe j! Z"e j �# e"d� � Z$e j �# e"d� � Z%d
� Z&d� Z'd� Z(d� Z)d� Z*d� Z+d� Z,d"d�Z- G d� d� � Z. G d� de/� � Z0 G d� de1� � Z2 G d� dej3 � � Z4 G d� d ej3 � � Z5d!� Z6ed
k r ej7 � � dS dS )#� )�verbose�requires_IEEE_754)�supportNg�h㈵��>�nan�inf�-inf)� ��7y�ACg�):��@g��7y�AC�__main__zmath_testcases.txtzcmath_testcases.txtc �z � t j dt j d| � � � � d }|dk r|dz }|S )a� Convert a non-NaN float x to an integer, in such a way that
adjacent floats are converted to adjacent integers. Then
abs(ulps(x) - ulps(y)) gives the difference in ulps between two
floats.
The results from this function will only make sense on platforms
where native doubles are represented in IEEE 754 binary64 format.
Note: 0.0 and -0.0 are converted to 0 and -1, respectively.
z<qz<dr l )�struct�unpack�pack)�x�ns �8/usr/local/apps/python3/lib/python3.11/test/test_math.py�to_ulpsr '