Indigo Rose Software

Go Back   Indigo Rose Software Forums > Indigo Rose Software > Developer's Den

Reply
 
Thread Tools Display Modes
  #1  
Old 07-20-2005
JimS's Avatar
JimS JimS is offline
Forum Member
 
Join Date: May 2003
Location: Pendleton, Oregon
Posts: 911
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
Reply With Quote
  #2  
Old 07-20-2005
Corey's Avatar
Corey Corey is offline
Registered User
 
Join Date: Aug 2002
Posts: 9,746
Multiply by negative one.
Reply With Quote
  #3  
Old 07-20-2005
JimS's Avatar
JimS JimS is offline
Forum Member
 
Join Date: May 2003
Location: Pendleton, Oregon
Posts: 911
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
Reply With Quote
  #4  
Old 07-20-2005
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,058
Ah, ha! That's a good idea I had not thought of myself.

__________________
Intrigued
www.amsuser.com
Reply With Quote
  #5  
Old 07-20-2005
Corey's Avatar
Corey Corey is offline
Registered User
 
Join Date: Aug 2002
Posts: 9,746
Quote:
I think it’s time to pull out the ol’skateboard, and leave the computer behind for a couple of hours.
*That's* the quote of the year. I just figured it out and so far this year I've averaged about 6 miles per day on my board. Yeee-eee-eeah!
Reply With Quote
  #6  
Old 07-20-2005
JimS's Avatar
JimS JimS is offline
Forum Member
 
Join Date: May 2003
Location: Pendleton, Oregon
Posts: 911
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. As soon as I replace my steel wheels with some of those new-fangled polyurethane ones with the enclosed bearings, I might be able to up my average by a couple of feet too.


.
__________________
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.
Reply With Quote
  #7  
Old 07-20-2005
Corey's Avatar
Corey Corey is offline
Registered User
 
Join Date: Aug 2002
Posts: 9,746
I owe my life to polyurethane wheels. Literally.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -6. The time now is 02:01 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software