This class is designed to convert a string in base Base.BINARY, Base.OCTAL, Base.HEXADECIMAL into a jscicalc.complex.Complex. More...
Classes | |
| class | Number |
| Private inner class used by ParseBase. More... | |
Static Public Member Functions | |
| static Complex | parseString (String s, Base b) |
| This is the function that Parser actually uses. | |
| static double | dparseString (String s, Base b) |
| This is the function that Parser uses for doubles. | |
| static void | main (String[] args) |
Static Public Attributes | |
| static final long | BIAS = 1023 |
| Standard constant for IEEE 754 doubles. | |
| static final long | E_MAX = 1023 |
| Standard constant for IEEE 754 doubles. | |
| static final long | E_MIN = -1022 |
| Standard constant for IEEE 754 doubles. | |
Static Private Member Functions | |
| static long | getDigit (char c) |
| String is composed from Numeral PObject objects. | |
This class is designed to convert a string in base Base.BINARY, Base.OCTAL, Base.HEXADECIMAL into a jscicalc.complex.Complex.
It also handles Base.DECIMAL by using a function in DOUBLE.
It was origainlly designed to convert a string in base Base.BINARY, Base.OCTAL, Base.HEXADECIMAL into a double. It also handles Base.DECIMAL by using a function in java.Math.BigDecimal. In fact it only needs to do this conversion because any number that we convert is a real or imaginary part, absolute value or argument.
When you enter an expression as a sequence of Numeral objects, Parser converts them to a string and then must convert the string to a double. This class does the conversion for Parser.
| static double jscicalc.ParseBase.dparseString | ( | String | s, | |
| Base | b | |||
| ) | [static] |
This is the function that Parser uses for doubles.
Converts a string to a double in Base b.
| s | The string (a number composed from Numeral objects) | |
| b | The Base |
References jscicalc.ParseBase.BIAS, jscicalc.ParseBase.E_MAX, jscicalc.ParseBase.E_MIN, jscicalc.ParseBase.Number.exponent, jscicalc.ParseBase.Number.negative, and jscicalc.ParseBase.Number.significand.
Referenced by jscicalc.ParseBase.parseString().
| static long jscicalc.ParseBase.getDigit | ( | char | c | ) | [static, private] |
String is composed from Numeral PObject objects.
Each contains a char and eventually we need to extract the char from a string and convert it into the corresponding integer
| c | a char representing a Numeral |
Referenced by jscicalc.ParseBase.Number.parseExponent(), and jscicalc.ParseBase.Number.parseSignificand().
| static void jscicalc.ParseBase.main | ( | String[] | args | ) | [static] |
References jscicalc.ParseBase.parseString(), and jscicalc.complex.Complex.real().
This is the function that Parser actually uses.
Converts a string to a double in Base b.
| s | The string (a number composed from Numeral objects) | |
| b | The Base |
References jscicalc.ParseBase.dparseString().
Referenced by jscicalc.ParseBase.main().
final long jscicalc.ParseBase.BIAS = 1023 [static] |
Standard constant for IEEE 754 doubles.
Referenced by jscicalc.ParseBase.dparseString().
final long jscicalc.ParseBase.E_MAX = 1023 [static] |
Standard constant for IEEE 754 doubles.
Referenced by jscicalc.ParseBase.dparseString().
final long jscicalc.ParseBase.E_MIN = -1022 [static] |
Standard constant for IEEE 754 doubles.
Referenced by jscicalc.ParseBase.dparseString().
1.7.1