/* float.pmc
 *  Copyright: 2003 The Perl Foundation.  All Rights Reserved.
 *  CVS Info $Id: float.pmc,v 1.3 2003/10/05 01:06:32 dan Exp $
 *  Overview:
 *	Float PMC class
 *  Data Structure and Algorithms:
 *  History:
 *  Notes:
 *      This class is for languages that want a value-restricted
 *      float type without going to an N register.
 *  References:
 */

#include "parrot/parrot.h"

pmclass Float extends mmd_default {

    void init() {	/* pmc2c doesn't like empty classes */
	SUPER();
    }

    void set_integer_native(INTVAL value) {
      SELF->cache.num_val = value;
    } 

    void set_number_native(FLOATVAL value) {
      SELF->cache.num_val = value;
    }

    void set_string_native(STRING* value) {
      SELF->cache.num_val = string_to_num(value);
    }

    FLOATVAL get_number() {
      return SELF->cache.num_val;
    }

   INTVAL get_integer() {
      return (INTVAL)SELF->cache.num_val;
   }

   STRING* get_string() {
      return string_from_num(INTERP, SELF->cache.num_val);
   }
}
