Source for file Double.class.php

Documentation is available at Double.class.php

  1. <?php
  2.  
  3. /**
  4. * @since 7/14/05
  5. * @package harmoni.primitives.numbers
  6. *
  7. * @copyright Copyright &copy; 2005, Middlebury College
  8. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  9. *
  10. * @version $Id: Double.class.php,v 1.5 2007/09/04 20:25:28 adamfranco Exp $
  11. */
  12.  
  13. require_once(dirname(__FILE__)."/Float.class.php");
  14.  
  15. /**
  16. * A simple Float data type.
  17. *
  18. * @package harmoni.primitives.numbers
  19. *
  20. * @copyright Copyright &copy; 2005, Middlebury College
  21. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  22. *
  23. * @version $Id: Double.class.php,v 1.5 2007/09/04 20:25:28 adamfranco Exp $
  24. */
  25. class Double
  26. extends Float
  27. {
  28. /*******************************************************
  29. * Class Methods - Instance Creation
  30. *********************************************************/
  31.  
  32.  
  33. /**
  34. * Answer a new object with the value specified
  35. *
  36. * @param mixed $value
  37. * @param optional string $class The class to instantiate. Do NOT use outside
  38. * of this package.
  39. * @return object Double
  40. * @access public
  41. * @since 7/14/05
  42. */
  43. function withValue ( $value, $class = 'Double') {
  44. return parent::withValue($value, $class);
  45. }
  46. /**
  47. * Answer a new object with the value specified
  48. *
  49. * @param string $string a string representation of the object
  50. * @return object Double
  51. * @access public
  52. * @since 3/14/06
  53. */
  54. function fromString ($string, $class = 'Double') {
  55. return parent::fromString($string, $class);
  56. }
  57. /**
  58. * Answer a new object with the value zero
  59. *
  60. * @param optional string $class The class to instantiate. Do NOT use outside
  61. * of this package.
  62. * @return object Double
  63. * @access public
  64. * @since 7/14/05
  65. */
  66. function zero ( $class = 'Double') {
  67. return parent::zero($class);
  68. }
  69. /*******************************************************
  70. * Instance Methods - Private
  71. *********************************************************/
  72.  
  73. /**
  74. * Set the internal value to a PHP primitive.
  75. *
  76. * @param mixed $value
  77. * @return void
  78. * @access private
  79. * @since 7/14/05
  80. */
  81. function _setValue ( $value ) {
  82. $this->_value = doubleval($value);
  83. }
  84. }

Documentation generated on Wed, 19 Sep 2007 10:22:49 -0400 by phpDocumentor 1.3.0RC3