jpl
public class Float extends Term
Float f = new Float( 3.14159265 );A Float can be used (and re-used) in Compound Terms. Two Float instances are equal (by .equals()) iff their (double) values are equal.
Copyright (C) 1998 Fred Dushin
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library Public License for more details.
Constructor Summary | |
---|---|
Float(double value)
This constructor creates a Float with the supplied
(double) value.
|
Method Summary | |
---|---|
Term | arg(int i)
throws a JPLException (arg(int) is defined only for Compound and Atom)
|
Term[] | args()
The (nonexistent) args of this Float
|
int | arity()
Returns the arity (0) of this Float
|
String | debugString()
Returns a debug-friendly String representation of this Float
|
double | doubleValue()
returns the (double) value of this Float
|
boolean | equals(Object obj)
Two Floats are equal if they are the same object, or their values are equal
|
float | floatValue()
returns the (double) value of this Float, converted to a float
|
boolean | hasFunctor(String name, int arity)
Tests whether this Float's functor has (String) 'name' and 'arity' (never)
|
boolean | hasFunctor(int val, int arity)
Tests whether this Float's functor has (int) 'name' and 'arity' (never)
|
boolean | hasFunctor(double val, int arity)
Tests whether this Float's functor has (double) 'name' and 'arity'
|
int | intValue()
returns the (double) value of this Float, converted to an int
|
long | longValue()
returns the (double) value of this Float, converted to a long
|
String | name()
throws a JPLException (name() is defined only for Compound, Atom and Variable)
|
String | toString()
Returns a Prolog source text representation of this Float
|
int | type() |
String | typeName() |
double | value()
The immutable value of this jpl.Float object, as a Java double
|
Parameters: value this Float's value
Returns: the ith argument (counting from 1) of this Float (never)
Returns: the (nonexistent) args of this Float
Returns: the arity (0) of this Float
Deprecated:
Returns a debug-friendly String representation of this FloatReturns: a debug-friendly String representation of this Float
Returns: the (double) value of this Float
Parameters: obj The Object to compare
Returns: true if the Object satisfies the above condition
Returns: the (double) value of this Float, converted to a float
Returns: whether this Float's functor has (String) 'name' and 'arity' (never)
Returns: whether this Float's functor has (int) 'name' and 'arity' (never)
Returns: whether this Float's functor has (double) 'name' and 'arity'
Returns: the (double) value of this Float, converted to an int
Returns: the (double) value of this Float, converted to a long
Returns: the name of this Float (never)
Returns: a Prolog source text representation of this Float
Deprecated:
The immutable value of this jpl.Float object, as a Java doubleReturns: the Float's value