FixUtil Documentation

Back to summary

import "util/double";

Double class

This class allows to work easilly with 64-bit floats.

Supported operators: +, -, *, /, <, >, <=, >=, ==, !=, +=, -=, *=, /= with Double, Float, Integer and Long types.
A short variant of the constructors is available: Double(...)

Members

var lo: Integer;
var hi: Integer;
The low and high order part of the 64-bit float.

Initialization

static function create(): Double
static function create(value: Float): Double
static function create(lo: Integer, hi: Integer): Double
Creates a new double with given value (or zero).
static function from_int(value: Integer): Double
static function from_long(value: Long): Double
Creates a new double from integer.
static function from_string(s: String): Double
Creates a new double from string representation, throwing an error on improper format.

Operations

function set(other: Double): Double
function set_int(value: Integer): Double
function set_long(value: Long): Double
function set_float(value: Float): Double
function set_string(s: String): Double
function set_raw(lo: Integer, hi: Integer): Double
Sets the value. Returns itself.
function dup(): Double
function add(other: Double): Double
function add_int(value: Integer): Double
function add_long(value: Long): Double
function add_float(value: Float): Double
Adds another value into this. Returns itself.
function sub(other: Double): Double
function sub_int(value: Integer): Double
function sub_long(value: Long): Double
function sub_float(value: Float): Double
Subtracts another value from this. Returns itself.
function mul(other: Double): Double
function mul_int(value: Integer): Double
function mul_long(value: Long): Double
function mul_float(value: Float): Double
Multiplies another value with this. Returns itself.
function div(other: Double): Double
function div_int(value: Integer): Double
function div_long(value: Long): Double
function div_float(value: Float): Double
Divides by another value. Returns itself.
function neg(): Double
function set_min(a: Double, b: Double): Double
function set_max(a: Double, b: Double): Double
Sets the min/max value. Returns itself.
function min(other: Double): Double
function min_float(value: Float): Double
function max(other: Double): Double
function max_float(value: Float): Double
Sets the min/max value. Returns itself.
function floor(): Double
Applies floor function. Returns itself.
function ceil(): Double
Applies ceil function. Returns itself.
function round(): Double
Applies round function. Returns itself.
function get_round_int(): Integer
function get_round_long(): Long
Returns the value as rounded integer.
function pow(other: Double): Double
function pow_float(value: Float): Double
Applies pow function. Returns itself.
function sqrt(): Double
function cbrt(): Double
function exp(): Double
function ln(): Double
function log2(): Double
function log10(): Double
function sin(): Double
function cos(): Double
function asin(): Double
function acos(): Double
function tan(): Double
function atan(): Double
function atan2(x: Double): Double
Applies common math functions. Returns itself.
function set_atan2(y: Double, x: Double): Double
Sets the result of atan2 function. Returns itself.

Properties

function is_zero(): Boolean
Returns true when the value is positive or negative zero.
function cmp_lt(other: Double): Boolean
function cmp_lt_int(value: Integer): Boolean
function cmp_lt_long(value: Long): Boolean
function cmp_lt_float(value: Float): Boolean
function cmp_le(other: Double): Boolean
function cmp_le_int(value: Integer): Boolean
function cmp_le_long(value: Long): Boolean
function cmp_le_float(value: Float): Boolean
function cmp_gt(other: Double): Boolean
function cmp_gt_int(value: Integer): Boolean
function cmp_gt_long(value: Long): Boolean
function cmp_gt_float(value: Float): Boolean
function cmp_ge(other: Double): Boolean
function cmp_ge_int(value: Integer): Boolean
function cmp_ge_long(value: Long): Boolean
function cmp_ge_float(value: Float): Boolean
function cmp_eq(other: Double): Boolean
function cmp_eq_int(value: Integer): Boolean
function cmp_eq_long(value: Long): Boolean
function cmp_eq_float(value: Float): Boolean
function cmp_ne(other: Double): Boolean
function cmp_ne_int(value: Integer): Boolean
function cmp_ne_long(value: Long): Boolean
function cmp_ne_float(value: Float): Boolean
Returns the result of comparison. There are 6 variants:
lt - less than
le - less than or equal
gt - greater than
ge - greater than or equal
eq - equal
ne - not equal
function to_int(): Integer
function to_long(): Long
function to_float(): Float
function to_string(): String
Returns the various representations of the value.