#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
|
|
|
|
#66927 - 2002-06-14 11:33 AM
Re: Ohms Law - Math routine
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Ridge? Good grief
You may call me Dick or Tricky if it's easier, just don't call me late for dinner.
I know imaginary numbers are useful, I'm on a wind-up. Just wanted to point out that far from being a math geek I'm more of a math numpty.
Translations and rotations using matrices make my head hurt.
My math tends towards the more practical - "I have £20 in my pocket. If I get a curry on the way home, how many pints of beer can I afford first?"
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1471 anonymous users online.
|
|
|