Previous Up Next

Module JavaDouble

module JavaDouble: sig .. end
Support for double type and Double class.


Instance creation

type t = java'lang'Double java_instance
The type of wrappers for double values.
val min_value : java_double
The smallest value for double values.
val max_value : java_double
The largest value for double values.
val nan : java_double
The not-a-number constant.
val negative_infinity : java_double
The constant for the negative infinity.
val positive_infinity : java_double
The constant for the positive infinity.
val make : java_double -> t
Returns a new java.lang.Double wrapper for the passed value.
val make_of_string : JavaString.t -> t
Returns a new java.lang.Double corresponding to the passed string; see Double(...) .
Raises Java_exception if the string is invalid

Operations

val byte_value : t -> java_byte
Returns the wrapped value, as a byte.
val double_value : t -> java_double
Returns the wrapped value, as a double.
val float_value : t -> java_float
Returns the wrapped value, as a float.
val int_value : t -> java_int
Returns the wrapped value, as an int.
val long_value : t -> java_long
Returns the wrapped value, as a long.
val short_value : t -> java_short
Returns the wrapped value, as a short.
val compare : java_double -> java_double -> java_int
Compares the passed values.
val compare_to : t -> t -> java_int
Compares the passed values.
val to_string : java_double -> JavaString.t
Converts the passed double into a string; see toString(...) .
val value_of : java_double -> t
Converts the passed bare double into a double wrapper; see valueOf(...) .
val parse_double : JavaString.t -> java_double
Converts the passed string into a double wrapper; see parseDouble(...) .
Raises Java_exception if the string is invalid
val value_of_string : JavaString.t -> t
Converts the passed string into a double wrapper; see valueOf(...) .
Raises Java_exception if the string is invalid

Null value

val null : t
The null value.
val is_null : t -> bool
is_null obj returns true iff obj is equal to null.
val is_not_null : t -> bool
is_not_null obj returns false iff obj is equal to null.

Miscellaneous

val wrap : t -> t option
wrap obj wraps the reference obj into an option type:
  • Some x if obj is not null;
  • None if obj is null.

val unwrap : t option -> t
unwrap obj unwraps the option obj into a bare reference:
  • Some x is mapped to x;
  • None is mapped to null.

AltStyle によって変換されたページ (->オリジナル) /