parcel | Clownfish |
class variable | CFISH_FLOAT |
struct symbol | cfish_Float |
class nickname | cfish_Float |
header file | Clownfish/Num.h |
Clownfish::Float – Immutable double precision floating point number.
cfish_Float*
cfish_Float_new(
double value
);
Return a new Float.
Initial value.
cfish_Float*
cfish_Float_init(
cfish_Float *self,
double value
);
Initialize a Float.
Initial value.
double
cfish_Float_Get_Value(
cfish_Float *self
);
Return the value of the Float.
int64_t
cfish_Float_To_I64(
cfish_Float *self
);
Convert the Float to an integer, truncating toward zero. Throw an
exception if the value is out of the range of an int64_t
.
cfish_String* // incremented
cfish_Float_To_String(
cfish_Float *self
);
Return the Float formatted as String using sprintf
with conversion
specifier %g
.
bool
cfish_Float_Equals(
cfish_Float *self,
cfish_Obj *other
);
Indicate whether two numbers are the same.
Returns: true if other
is a Float or Integer with the same value as
self
.
int32_t
cfish_Float_Compare_To(
cfish_Float *self,
cfish_Obj *other
);
Indicate whether one number is less than, equal to, or greater than
another. Throws an exception if other
is neither a Float nor an
Integer.
Returns: 0 if the numbers are equal, a negative number if self
is
less than other
, and a positive number if self
is greater than
other
.
cfish_Float* // incremented
cfish_Float_Clone(
cfish_Float *self
);
Return a clone of the object.
Clownfish::Float is a Clownfish::Obj.
Copyright © 2010-2015 The Apache Software Foundation, Licensed under the
Apache License, Version 2.0.
Apache Lucy, Lucy, Apache, the Apache feather logo, and the Apache Lucy project logo are trademarks of The
Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their
respective owners.