Al-HUWAITI Shell
Al-huwaiti


Server : Apache
System : Linux dedi-14684855.grupobig.com 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : grupo692 ( 1004)
PHP Version : 8.3.32
Disable Function : NONE
Directory :  /proc/thread-self/root/usr/include/OpenEXR/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/thread-self/root/usr/include/OpenEXR/ImfRational.h
//
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) Contributors to the OpenEXR Project.
//

#ifndef INCLUDED_IMF_RATIONAL_H
#define INCLUDED_IMF_RATIONAL_H

#include "ImfExport.h"
#include "ImfNamespace.h"

//-----------------------------------------------------------------------------
//
//	Rational numbers
//
//	A rational number is represented as pair of integers, n and d.
//	The value of of the rational number is
// 
//		n/d			for d > 0
//		positive infinity	for n > 0, d == 0
//		negative infinity	for n < 0, d == 0
//		not a number (NaN)	for n == 0, d == 0
//
//-----------------------------------------------------------------------------

OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER


class IMF_EXPORT_TYPE Rational
{
  public:

    int			n;		// numerator
    unsigned int	d;		// denominator


    //----------------------------------------
    // Default constructor, sets value to zero
    //----------------------------------------

    Rational (): n (0), d (1) {}


    //-------------------------------------
    // Constructor, explicitly sets n and d
    //-------------------------------------

    Rational (int n, int d): n (n), d (d) {}


    //----------------------------
    // Constructor, approximates x
    //----------------------------

    IMF_EXPORT
    explicit Rational (double x);


    //---------------------------------
    // Approximate conversion to double
    //---------------------------------

    operator double () const {return double (n) / double (d);}
};


OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT

#endif

Al-HUWAITI Shell