Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • \$\begingroup\$ 1) why eval(prompt) when a function is allowed? 2)There must be at least 1 digit after the decimal point. 3)no need to store M, just d=M-m \$\endgroup\$ Commented Oct 1, 2014 at 13:27
  • \$\begingroup\$ Updated. Although, getting at least 1 digit after decimal is tough \$\endgroup\$ Commented Oct 1, 2014 at 13:31
  • \$\begingroup\$ If you want, you can round the output to 2 digits after the decimal point that's the simpler way I think \$\endgroup\$ Commented Oct 1, 2014 at 13:44
  • \$\begingroup\$ @edc65 But there is no way to convert 1 to 1.0 except for what I did. \$\endgroup\$ Commented Oct 1, 2014 at 13:55
  • \$\begingroup\$ Nope. May I hint? \$\endgroup\$ Commented Oct 1, 2014 at 13:57