
Classes | |
| class | DoubleFormat |
| A private inner class that is similar in structure to ParseBase.Number. More... | |
Public Types | |
| enum | Notation { STANDARD, SCIENTIFIC, SCIENTIFICB, NONE } |
This is an enumerated type representing the possible notations that we can use. More... | |
Public Member Functions | |
| Format (Complex z, Base b) | |
| Constructor. | |
| String | formatStandard (Base base, int sigDigits, int maxLength, boolean showComplex, boolean rectangularComplex) |
| Method that creates a string (ideally in standard notation) representation of a number to sigDigits significant digits. | |
Static Public Member Functions | |
| static void | main (String[] args) |
| Test function. | |
Package Attributes | |
| boolean | realSign |
| Sign of real part (true for negative). | |
| boolean | imaginarySign |
| Sign of imaginary part (true for negative). | |
Static Private Member Functions | |
| static String | correctMinus (String s) |
| Used to replace hyphens with true minus signs. | |
Private Attributes | |
| final Complex | z |
| This is where the number is stored. | |
| DoubleFormat | real |
| The real part. | |
| DoubleFormat | imaginary |
| The imaginary part. | |
| DoubleFormat | abs |
| The absoulte value. | |
| DoubleFormat | argument |
| The argument. | |
Static Private Attributes | |
| static final double | SMALLIMAGINARY = 0.00005 |
| A calculation (e.g. | |
Constructor.
This takes a Complex z and a Base b.
| z | The complex number | |
| b | The base |
References jscicalc.complex.Complex.abs(), jscicalc.complex.Format.abs, jscicalc.complex.Complex.arg(), jscicalc.complex.Format.argument, jscicalc.complex.Complex.imaginary(), jscicalc.complex.Format.imaginary, jscicalc.complex.Format.imaginarySign, jscicalc.complex.Complex.real(), jscicalc.complex.Format.real, and jscicalc.complex.Format.realSign.
Referenced by jscicalc.complex.Format.main().
| static String jscicalc.complex.Format.correctMinus | ( | String | s | ) | [static, private] |
Used to replace hyphens with true minus signs.
| s | A String |
Referenced by jscicalc.complex.Format.formatStandard().
| String jscicalc.complex.Format.formatStandard | ( | Base | base, | |
| int | sigDigits, | |||
| int | maxLength, | |||
| boolean | showComplex, | |||
| boolean | rectangularComplex | |||
| ) |
Method that creates a string (ideally in standard notation) representation of a number to sigDigits significant digits.
If maxLength is exceeded it resorts to scientific notation.
| base | Base: mut be 2, 8, 10 or 16 | |
| sigDigits | Desired number of significant digits | |
| maxLength | The maximum number of characters in the string produced | |
| showComplex | Set to true if you want to show imaginary part even when smaller than smallImaginary. | |
| rectangularComplex | Set to true if you want complex numbers in rectangular notation. |
References jscicalc.complex.Complex.abs(), jscicalc.complex.Format.abs, jscicalc.complex.Complex.arg(), jscicalc.complex.Format.argument, jscicalc.complex.Format.correctMinus(), jscicalc.complex.Complex.imaginary(), jscicalc.complex.Format.imaginary, jscicalc.complex.Format.imaginarySign, jscicalc.complex.Format.DoubleFormat.precision(), jscicalc.complex.Complex.real(), jscicalc.complex.Format.real, jscicalc.complex.Format.realSign, jscicalc.complex.Format.DoubleFormat.round(), jscicalc.complex.Format.DoubleFormat.scientific(), jscicalc.complex.Format.DoubleFormat.scientificB(), jscicalc.complex.Format.DoubleFormat.scientificBPrecision(), jscicalc.complex.Format.DoubleFormat.scientificPrecision(), jscicalc.complex.Format.DoubleFormat.standard(), and jscicalc.complex.Format.z.
Referenced by jscicalc.complex.Format.main().
| static void jscicalc.complex.Format.main | ( | String[] | args | ) | [static] |
Test function.
References jscicalc.complex.Format.Format(), and jscicalc.complex.Format.formatStandard().
DoubleFormat jscicalc.complex.Format.abs [private] |
The absoulte value.
Referenced by jscicalc.complex.Format.Format(), and jscicalc.complex.Format.formatStandard().
DoubleFormat jscicalc.complex.Format.argument [private] |
The argument.
Referenced by jscicalc.complex.Format.Format(), and jscicalc.complex.Format.formatStandard().
The imaginary part.
Referenced by jscicalc.complex.Format.Format(), and jscicalc.complex.Format.formatStandard().
boolean jscicalc.complex.Format.imaginarySign [package] |
Sign of imaginary part (true for negative).
Referenced by jscicalc.complex.Format.Format(), and jscicalc.complex.Format.formatStandard().
DoubleFormat jscicalc.complex.Format.real [private] |
The real part.
Referenced by jscicalc.complex.Format.Format(), and jscicalc.complex.Format.formatStandard().
boolean jscicalc.complex.Format.realSign [package] |
Sign of real part (true for negative).
Referenced by jscicalc.complex.Format.Format(), and jscicalc.complex.Format.formatStandard().
final double jscicalc.complex.Format.SMALLIMAGINARY = 0.00005 [static, private] |
A calculation (e.g.
sin) might create a small imaginary part. If it is smaller than this number in size AND showComplex == false, don’t show it.
final Complex jscicalc.complex.Format.z [private] |
This is where the number is stored.
Referenced by jscicalc.complex.Format.DoubleFormat.exponentDigits(), jscicalc.complex.Format.formatStandard(), jscicalc.complex.Format.DoubleFormat.scientific(), jscicalc.complex.Format.DoubleFormat.scientificBPrecision(), jscicalc.complex.Format.DoubleFormat.scientificLength(), jscicalc.complex.Format.DoubleFormat.scientificPrecision(), and jscicalc.complex.Format.DoubleFormat.standard().
1.7.1