BCDFraction

Decimal_Fraction Arithmetic.

For the use in an FX-603P Simulator the precision is fixed at 14 decimal digits.

Constructors

Link copied to clipboard
constructor(Value: BCDFraction)
create new fraction
constructor(Whole: BCDInteger)
create new fraction
constructor(Numerator: BCDInteger, Denominator: BCDInteger)
create new fraction
constructor(Whole: Long)
create new fraction
constructor(Whole: Long, Numerator: Long, Denominator: Long)
create new fraction
constructor(Whole: Number, Numerator: Number, Denominator: BCDInteger)
create new fraction
constructor(Text: String)
create new fraction from a string

Properties

Link copied to clipboard
e approximation used for unit tests
Link copied to clipboard
π approximation used for unit tests
Link copied to clipboard
Compare result.
Link copied to clipboard
Compare result.
Link copied to clipboard
val Compare_Less: Int = -1
Compare result.
Link copied to clipboard
private open var Denominator: BCDInteger
The Denominator: Whole + Numerator / Denominator
Link copied to clipboard
Effectivly needed precision.
Link copied to clipboard
private val Logger: Logger
Class logger instance.
Link copied to clipboard
val Max_Precision: Int = 18
Max supported precision.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
private open var Numerator: BCDInteger
The Numerator: Numerator / Denominator
Link copied to clipboard
private val TAG: String
Class logger tag.
Link copied to clipboard
private val Values_2: Pattern
matches «2/3»
Link copied to clipboard
private val Values_3: Pattern
matches «1 2/3»

Functions

Link copied to clipboard
open fun $div(y: Number): Number
x ÷ y
Link copied to clipboard
open fun $minus(y: Number): Number
x - y
Link copied to clipboard
open fun $plus(y: Number): Number
x + y
Link copied to clipboard
open fun $times(y: Number): Number
x × y
Link copied to clipboard
open fun $times$times(y: Number): Number
xy
Link copied to clipboard
open fun a(): BCDInteger
Fraktur represented as «a b/c»
Link copied to clipboard
open fun abs(): Number
|x|
Link copied to clipboard
open fun and(y: Number): Number
Logical and
Link copied to clipboard
open fun arc_cos(): Number
open fun arc_cos(Half_Circle: Number): Number
arc cosine
Link copied to clipboard
open fun arc_cos_hyp(): Number
area hyperbolic cosine: loge (x + √(x-1) × √(x+1))
Link copied to clipboard
open fun arc_sin(): Number
open fun arc_sin(Half_Circle: Number): Number
arc sine
Link copied to clipboard
open fun arc_sin_hyp(): Number
area hyperbolic sine: loge (x + √(x² + 1))
Link copied to clipboard
open fun arc_tan(): Number
open fun arc_tan(Half_Circle: Number): Number
arc tangent
Link copied to clipboard
open fun arc_tan_hyp(): Number
area hyperbolic tangent: loge ((1 + x) ÷ (1 - x)) / 2
Link copied to clipboard
open fun As_BCDFloat(): BCDFloat
Either convert to a BCDFloat or return this.
Link copied to clipboard
Either convert to a or return this.
Link copied to clipboard
Either convert to a BCDInteger or return this.
Link copied to clipboard
open fun b(): BCDInteger
Fraktur represented as «a b/c»
Link copied to clipboard
open fun c(): BCDInteger
Fraktur represented as «a b/c» or «d/c»
Link copied to clipboard
open fun Clone(): Number
clone the float - but it might be easier to use the provided copy Constructor instead.
Link copied to clipboard
open fun clone(): Any
clone the float - but it might be easier to use the provided copy Constructor instead.
Link copied to clipboard
coefficient - while a 18 digits number can also be represented as an long an 18digits multiplication need a 36digits temporary and that is more then a long can do.
Link copied to clipboard
open fun Compare(Value: Number): Int
Compare values
Link copied to clipboard
abstract fun compareTo(p: T): Int
open fun compareTo(rightValue: Number): Int
Link copied to clipboard
open fun cos(): Number
cos (x)
open fun cos(Half_Circle: Number): Number
cosine
Link copied to clipboard
open fun cos_hyp(): Number
Hyperbolic cosine: (Exponent^x + Exponent^-x)/2
Link copied to clipboard
open fun d(): BCDInteger
Fraktur represented as «d/c».
Link copied to clipboard
open fun Digits(): Array<Byte>
number: sum(i = 0 ...
Link copied to clipboard
open fun div(y: Number): Number
x ÷ y
Link copied to clipboard
open fun equals(rightValue: Any): Boolean
Link copied to clipboard
open fun exp_10(): Number
10x
Link copied to clipboard
open fun exp_e(): Number
ex
Link copied to clipboard
open fun Exponent(): Int
current exponent - note that the exponent is based on the internal representation where the radix point is right most.
Link copied to clipboard
protected open fun finalize()
Link copied to clipboard
open fun Fix(Decimal: Int, Exponent: Int): Number
Round to a given Precision after the decimal point.
Link copied to clipboard
open fun Frac(): Number
Recompose a frac double from the given data.
Link copied to clipboard
fun getClass(): Class<out Any>
Link copied to clipboard
open fun hashCode(): Int
Link copied to clipboard
open fun Indirect_Value(Digit_Count: Int): Int
Get valuef or indirect addressing.
Link copied to clipboard
open fun Integer(): Number
integer part of the BCDFloat Do not mix up with To_Integer - This version returns another BCDFloat!
Link copied to clipboard
open fun Is_Finite(): Boolean
current value is a normal number
Link copied to clipboard
open fun Is_Infinite(): Boolean
current value is Infinity (but not N/A).
Link copied to clipboard
open fun Is_Integer(): Boolean
Current value is integer value.
Link copied to clipboard
open fun Is_NaN(): Boolean
current value is not a number
Link copied to clipboard
open fun Is_Negative(): Boolean
Current value us negative
Link copied to clipboard
open fun Is_Zero(): Boolean
value is 0
Link copied to clipboard
open fun log_10(): Number
log10 (x)
Link copied to clipboard
open fun log_e(): Number
loge (x)
Link copied to clipboard
open fun minus(y: Number): Number
x - y
Link copied to clipboard
open fun neg(): Number
Link copied to clipboard
open fun Normalize()
normalize the value depending on type: remove leading zeros and / or trailing zeros
Link copied to clipboard
open fun not(): Number
Logical not
Link copied to clipboard
fun notify()
Link copied to clipboard
fun notifyAll()
Link copied to clipboard
open fun Num_Digits(): Int
the current number of digits - not that when the number is not normalised there might be more 0's in the number then strictly needed.
Link copied to clipboard
open fun or(y: Number): Number
Logical or
Link copied to clipboard
open fun P_To_X(θ: Number): Number
open fun P_To_X(θ: Number, Half_Circle: Number): Number
Convert Polar to Rectangle Coordinates
Link copied to clipboard
open fun P_To_Y(θ: Number): Number
open fun P_To_Y(θ: Number, Half_Circle: Number): Number
Convert Polar to Rectangle Coordinates
Link copied to clipboard
open fun plus(y: Number): Number
x + y
Link copied to clipboard
open fun pow(y: Number): Number
xy
Link copied to clipboard
open fun R_To_R(y: Number): Number
Convert Rectangle to Polar Coordinates
Link copied to clipboard
open fun R_To_θ(y: Number): Number
open fun R_To_θ(y: Number, Half_Circle: Number): Number
Convert Rectangle to Polar Coordinates
Link copied to clipboard
open fun root(r: Number): Number
r√x
Link copied to clipboard
open fun Round(): Number
Round to effective Precision and Exponent.
open fun Round(Precision: Int, Exponent: Int): Number
Round to a given Precision and Exponent.
Link copied to clipboard
open fun sin(): Number
open fun sin(Half_Circle: Number): Number
sine
Link copied to clipboard
open fun sin_hyp(): Number
hyperbolic sine: (ex - e-x) ÷ 2
Link copied to clipboard
open fun square(): Number
x2
Link copied to clipboard
open fun square_root(): Number
2√x
Link copied to clipboard
open fun tan(): Number
tan x
open fun tan(Half_Circle: Number): Number
tangent
Link copied to clipboard
open fun tan_hyp(): Number
Hyperbolic tangent: (e2x - 1) ÷ (e2x + 1)
Link copied to clipboard
open fun times(y: Number): Number
x × y
Link copied to clipboard
convert to native/debug string representation
Link copied to clipboard
open fun To_Integer(): Int
Convert to integer Do not mix up with Integer - This version returns a Java int!
Link copied to clipboard
open fun To_Long(): Long
Convert to long integer Do not mix up with Integer - This version returns a Java int!
Link copied to clipboard
open fun toString(): String
display as debug string
Link copied to clipboard
fun wait()
Link copied to clipboard
open fun xor(y: Number): Number
Logical xor