How does one enter a negative DOUBLE/SINGLE constant in XB?
It takes a little work to determine the value, but you would enter it as a “DOUBLE image” preferably. A DOUBLE image is more accurate than entering the decimal anyway. It is written as the prefix “0d” followed by 16 hex digits. A good example can be found in the xma.dec file (which is the file you see in the PDE by selecting help|math). Towards the end of that file, after the function declarations, mathematical constants such as $$PI and $$E are declared. $$PI = 0d400921FB54442D18 In order to determine the representation of a particular DOUBLE value, you would have to use DHIGH and DLOW to convert the binary representation into two XLONG values, then convert those into two hex strings. Example: FUNCTION DoubleImage$ (DOUBLE x) xhigh = DHIGH(x) xlow = DLOW(x) RETURN (“0d”+HEX$(xhigh, 8)+ HEX$(xlow, 8)) END FUNCTION x# = -1.2345 d$ = DoubleImage$ (x#) PRINT x#, d$, DOUBLE(d$) This gives us the following results: -1.2345 0dBFF3C083126E978D -1.2345 So we can define our constant for -1.2345