public class OtpErlangDouble extends OtpErlangObject
OtpErlangFloat
are used to provide representations corresponding to
the Java types Double and Float.Constructor and Description |
---|
OtpErlangDouble(double d)
Create an Erlang float from the given double value.
|
OtpErlangDouble(OtpInputStream buf)
Create an Erlang float from a stream containing a double encoded in
Erlang external format.
|
Modifier and Type | Method and Description |
---|---|
double |
doubleValue()
Get the value, as a double.
|
void |
encode(OtpOutputStream buf)
Convert this double to the equivalent Erlang external representation.
|
boolean |
equals(java.lang.Object o)
Determine if two floats are equal.
|
float |
floatValue()
Get the value, as a float.
|
java.lang.String |
toString()
Get the string representation of this double.
|
public OtpErlangDouble(double d)
public OtpErlangDouble(OtpInputStream buf) throws OtpErlangDecodeException
buf
- the stream containing the encoded value.OtpErlangDecodeException
- if the buffer does not contain a valid external
representation of an Erlang float.public double doubleValue()
public void encode(OtpOutputStream buf)
encode
in class OtpErlangObject
buf
- an output stream to which the encoded value should be written.public boolean equals(java.lang.Object o)
equals
in class OtpErlangObject
o
- the float to compare to.public float floatValue() throws OtpErlangRangeException
OtpErlangRangeException
- if the value cannot be represented as a float.public java.lang.String toString()
toString
in class OtpErlangObject