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
Division?
-
josh
- Posts: 2403
- Joined: May 5th, 2014, 12:49 pm
- Location: Washington DC
Re: Division?
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?
(I knew it: How utterly embarrasing..
)
Thanks
Thanks