1

I am trying to write a compound formula in a programming language that doesn't have decimal places.

For something that I thought was going to be simple.. I seem to be struggling a bit..

Using Excel as a test area I have written;

1 * (1 + 0.0025) ^ 2212

Which equals 250.4 (rounded).

I'm struggling to write this without the 0.0025 (representing 0.25%). Is there a way I can multiply this equation out so that I don't have to use 0.0025 to represent 0.25%?

For example, have 0.25% represented as 25?

Thanks!

  • 0.25% = 25/10000. – quasi Feb 19 '18 at 08:06
  • Does your programming language have floating point numbers? – quasi Feb 19 '18 at 08:08
  • I agree with quasi, you can write $$ (1 + 0.0025)^{2212} = (1 + 25/1000)^{2212} $$ However, it seems odd that you would do mathematical calculations in a programming language that does not have decimal places. Especially with percentages, the decimal places can make a huge difference. – Matti P. Feb 19 '18 at 08:12
  • Nope, does not have floating point. The language is called Solidity (used for Ethereum). I have tried (1+25/1000) and it does not seem to work as intended... – MitchellNZ Feb 19 '18 at 08:31
  • @MitchellNZ: https://ethereum.stackexchange.com/questions/tagged/solidity – quasi Feb 20 '18 at 04:52

0 Answers0