#66925 - 2002-06-14 10:22 AM
Re: Ohms Law - Math routine
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Oops, quote from me: quote: Interestingly "0.0+$a/$b" won't work. Due to operator precedence, "$a/$b" is evaluated first, and as an integer expression will result in "1". Adding 0.0 to it will have no effect.
Not quite true. Adding "0.0" to the result will cause the expression to become double, so the variable will become double. The result of "$a/$b" will still be an integer result, so you will end up with an double variable containing an integer result.
quote: Nice to have a coding/math geek on board.
Nah, I gave up math at our 'A'-level education stage. They started talking about imaginary numbers and that offended my sense of reason. Trigonomentry? I can see where that is useful, but I can make up numbers all day long without tax-payers footing the charge for formal education. (Donning flame-proof suit, heh)
BTW Thank-you to the anonymous poster who pushed my votes into double figures
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1471 anonymous users online.
|
|
|