Re: (geen onderwerp)



Gert Baars wrote:

Then what if A and B are Int64's. Intermediate results
still can become too large.

Correct. A good programmer knows this and will either choose the
correct data type to do the calculations with (e.g. if Int64 is too
small, you choose one of the floating point types), or choose the order
of calculations thus that the results will fit.

You can't expect the compiler to do all the thinking for you, or even
to choose the correct types for you.
--
Rudy Velthuis http://rvelthuis.de/

"Don't stay in bed, unless you can make money in bed."
- George Burns (1896-1996)
.



Relevant Pages

  • Re: Stroustrups FAQ causes infinite loop when executed
    ... There may be ways in which inheritance could ... programmer could not have foreseen. ... >> complex calculations such as multiplying numerous transformation ... >> reason to cap the class. ...
    (comp.lang.cpp)
  • Re: _sntprintf and _sntprintf_s
    ... I think in this case number of characters means TCHAR's, ... keep track of how much space remains in the buffer. ... If a programmer is using the ANSI version then the programmer wants to do ... calculations on the number of bytes in order to keep track of how much ...
    (microsoft.public.vc.language)
  • Calculations - How to do it
    ... Need your help in trying to figure out the best way to do some calculations and present it back to the user. ... I am an intermediate VB programmer so be gentle. ... BRIAN HAMMER ...
    (microsoft.public.dotnet.framework.windowsforms)