Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Maths Problem
#1
I want to subtract 25.40 from 25.35 and the result should be -0.05 in all the 3 variable are of double type. In QM it shows answer in exponetial form ie 4.99999999999972E-02. I want just simply -0.05 as result to be stored in C variable as it is to be compared with D for further processing. I am using below code.

double a= 25.40
double b= 25.35
double c=a-b
out c
#2
In other programs the same.
You can use CURRENCY or DECIMAL type instead of double. Then don't use operators. Use sub and other functions. CURRENCY is limited to 4 digits after .

Macro
Code:
Copy      Help
DECIMAL a= 25.40
DECIMAL b= 25.35
DECIMAL c
c.sub(a b)
out c
#3
Is DECIMAL new? I don't remember seeing that one in the past...maybe I just missed it Wink
#4
not new


Forum Jump:


Users browsing this thread: 1 Guest(s)