Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What do I do if I need floating-point maths support?

floating-point Maths support
0
Posted

What do I do if I need floating-point maths support?

0

The first question you should ask is whether you really, really need decimal maths (rather than integers), or whether you’d be better off scaling your quantities to integers instead. For example, you could represent the sum of money `twelve pounds and five pence’ as the decimal number 12.05 (pounds). But you could equally well represent it as 1205 (pence). Provided all your amounts are in pence, you’ll still get the right answer (in pence) when you add, subtract, multiply, or divide them (but watch out for rounding errors). Things are a bit more complicated when you need to scale different quantities by different amounts. For example, if you multiply velocity in metres per second, by time in seconds, you get distance in metres. Suppose you have velocities of millimetres per second, and times of milliseconds? If you scale both these quantities by a factor of 1000, how much will you have to correct the final answer by? Unless you are a physicist, you probably aren’t very familiar with wo

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123