Fix()
Create a Fix number with unspecified precision and value zero.
Fix(int length, int intbits)
Create a Fix number with total word length of length bits and intbits bits to the left of the binary point. The value is set to zero. If the precision parameters are not valid, an error bit is internally set so that the invalid method will return TRUE.
Fix(const char* precisionString)
Create a Fix number whose precision is determined by precisionString, which has the syntax lef tbits.rightbits, where lef tbits is the number of bits to the left of the binary point and rightbits is the number of bits to the right of the binary point, or rightbits/totalbits, where totalbits is the total number of bits. The value is set to zero. If the precisionString is not in the proper format, an error bit is internally set so that the invalid method will return TRUE.
Fix(double value)
Create a Fix with the default precision of 24 total bits for the word length and set the number of integer bits to the minimum needed to represent the integer part of the number value. If the given value needs more than 24 bits to be represent, the value will be clipped and the number stored will be the largest possible under the default precision (i.e. saturation occurs). In this case an internal error bit is set so that the ovf_occurred method will return TRUE.
Fix(int length, int intbits, double value)
Create a Fix with the specified precision and set its value to the given value. The number is rounded to the closest representable number given the precision. If the precision parameters are not valid, then an error bit is internally set so that the invalid method will return TRUE.
Fix(const char* precisionString, double value)
Same as the previous constructor except that the precision is specified by the given precisionString instead of as two integer arguments. If the precision parameters are not valid, an error bit is internally set so that the invalid method will return TRUE when called on the object.
Fix(const char* precisionString, uint16* bits)
Create a Fix with the specified precision and set the bits precisely to the ones in the given bits argument. The first word pointed to by bits contains the most significant 16 bits of the representation. Only as many words as necessary to fetch the bits will be referenced from the bits argument. For example:
Fix("2.14",bits)will only reference bits[0].
This constructor gets very close to the representation and is meant mainly for debugging. It may be removed in the future.
Fix(const Fix& arg)
Copy constructor. Produces an exact duplicate of arg.
Fix(int length, int intbits, const Fix& arg)
Read the value from the arg and set to a new precision. If the precision parameters are not valid, an error bit is internally set so that the invalid method will return TRUE when called on the object. If the value from the source will not fit, an error bit is set so that the ovf_occurred method will return TRUE.