|
#1
|
||||
|
||||
|
Positive to Negative, Negative to Positive
Does anyone know of a slick way to convert positive numbers to negative numbers, and negative numbers to positive ones?
I can check the input string to see if the negative sign – is the first digit, and make my change that way, I know. With my limited knowledge of math, I was wondering if I might be overlooking the obvious. Thanks. .
__________________
Add-ons for AMS. Toolbar Buttons Galore, System Animations, the Window Construction Kit, and more. Visit Acme-Tek |
|
#2
|
||||
|
||||
|
Multiply by negative one.
|
|
#3
|
||||
|
||||
|
Thank you Corey. At least I was smart enough to ask, before I wrote a tight 12 lines of code that was almost able to do the same thing.
When the answer to a vexing problem is that easy, I think it’s time to pull out the ol’skateboard, and leave the computer behind for a couple of hours. Thanks again. .
__________________
Add-ons for AMS. Toolbar Buttons Galore, System Animations, the Window Construction Kit, and more. Visit Acme-Tek |
|
#4
|
||||
|
||||
|
Ah, ha! That's a good idea I had not thought of myself.
|
|
#5
|
||||
|
||||
|
Quote:
|
|
#6
|
||||
|
||||
|
A positive number multiplied by a positive number is always a positive number
A positive number multiplied by a negative number is always a negative number A negative number multiplied by a negative number is always a positive number Oh yea, it’s coming back to me now. It looks like Corey paid attention in 5th grade math class. Although in Canada, that’s probably 3rd grade stuff. 6 miles a day, that’s a great average. .
__________________
Add-ons for AMS. Toolbar Buttons Galore, System Animations, the Window Construction Kit, and more. Visit Acme-Tek Last edited by JimS; 07-20-2005 at 02:00 AM. |
|
#7
|
||||
|
||||
|
I owe my life to polyurethane wheels. Literally.
|
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
All times are GMT -6. The time now is 02:01 PM.








Linear Mode
