Division?

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
Anne
Posts: 104
Joined: January 11th, 2012, 12:55 am

Division?

Post by Anne »

This is a question I never thought I would ask in this forum, but how do we divide numbers?

I tried the following:

errmsg("%d", 1/3);

and the result was 0, but I want 0.33333

The manual claims that / is the division operator working on numeric expressions and also that a numeric variable is an integer or decimal number significant to 15 digits, so it should work, shouldn't it?

Anne
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Division?

Post by josh »

The division is fine but I think you need %f instead of %d in the errmsg
Anne
Posts: 104
Joined: January 11th, 2012, 12:55 am

Re: Division?

Post by Anne »

(I knew it: How utterly embarrasing.. :oops: )

Thanks
Post Reply