Re: Removing the precision from double

2018-11-01 Thread Neia Neutuladh via Digitalmars-d-learn
On Thu, 01 Nov 2018 23:59:26 +, kerdemdemir wrote: > I am doing trading and super scared of suprices like mathematical errors > during the multiplications(or division 1/tickSize) since market will > reject my orders even if there is a small mistake. > > Is this safe? Or is there a better way o

Re: Removing the precision from double

2018-11-01 Thread Nicholas Wilson via Digitalmars-d-learn
On Thursday, 1 November 2018 at 23:59:26 UTC, kerdemdemir wrote: I have two numbers First The price = 0.0016123 Second Maximum allowed precision = 0.0001(it can be only 0.001, 0.0001, 0.1, ..., 0.01 bunch of zeros and than a one that is it) Anything more precise than the

Re: Removing the precision from double

2018-11-01 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Nov 01, 2018 at 11:59:26PM +, kerdemdemir via Digitalmars-d-learn wrote: > I have two numbers > > First The price = 0.0016123 > Second Maximum allowed precision = 0.0001(it can be only 0.001, > 0.0001, 0.1, ..., 0.01 bunch of zeros and than a one that > is it) Be

Removing the precision from double

2018-11-01 Thread kerdemdemir via Digitalmars-d-learn
I have two numbers First The price = 0.0016123 Second Maximum allowed precision = 0.0001(it can be only 0.001, 0.0001, 0.1, ..., 0.01 bunch of zeros and than a one that is it) Anything more precise than the allow precision should truncated. So in this case 0.0016123 s