Math_Fraction
[ class tree: Math_Fraction ] [ index: Math_Fraction ] [ all elements ]

Class: Math_Fraction

Source Location: /Math_Fraction-0.4.1/Fraction.php

Class Overview


Math_Fraction: class to represent and manipulate fractions (n = a/b)


Author(s):

Version:

  • 0.4.1

Methods


Inherited Variables

Inherited Methods


Class Details

[line 30]
Math_Fraction: class to represent and manipulate fractions (n = a/b)
  • Author: Kouber Saparev <kouber@php.net>
  • Version: 0.4.1
  • Access: public


[ Top ]


Method Detail

Math_Fraction (Constructor)   [line 56]

object Math_Fraction Math_Fraction( mixed $num, [int $den = null])

Constructor for Math_Fraction
  • Access: public

Parameters:

mixed   $num   —  Integer for the Numerator or a Float that the fraction will be built from.
int   $den   —  Denominator

[ Top ]

getDen   [line 122]

int getDen( )

Returns the denominator of the fraction
  • Access: public

[ Top ]

getNum   [line 112]

int getNum( )

Returns the numerator of the fraction
  • Access: public

[ Top ]

toFloat   [line 133]

float toFloat( )

Float evaluation of the fraction
  • Access: public

[ Top ]

toString   [line 146]

string toString( )

String representation of the fraction
  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:07:36 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.