Class DDouble

Inherits from:
Object
Conforms to:
DComparable, DDatable, DParsable, DTextable
Declared in:
DDouble.h

Class Hierarchy

    Object
      |
      +---DDouble

Class Description

The Double class implements a number of methods for storing and manipulating double numbers.

Example:
#include <stdio.h>
#include "ofc/DDouble.h"

int main(int argc, char *argv[])
{
  DDouble *db1  = [DDouble alloc];
  DDouble *db2  = [DDouble new  ];
  DText   *str;

  [db1 init :7.0];                     // Init with a value

  [db2 set :14.0];                     // Set with a value

  str = [db1 toText];
  printf("Double1 is:%.1f and \"%s\".\n", [db1 get], [str cstring]);
  [str free];

  if ([db1 compare :db2] == 0)
    printf("Double1 is equal to double2.\n");
  else
    if ([db1 compare :db2] < 0)
      printf("Double1 is smaller than double2.\n");
    else
      printf("Double1 is greater than double2.\n");

  [db1 free];                          // Cleanup
  [db2 free];

  return 0;
}
Last modified:
24-Jul-2008 (DDouble.h)

Instance Variables

private double _double

Method Index


generated 06-Sep-2008 by ObjcDoc 3.0.0