Solved

how to change a possitive value to negative

Posted on 2007-11-22
4
153 Views
Last Modified: 2010-04-05
Hello guys,

I have a variable with this value 145.74
I would like to change the value to - 145.74

To change from negative to possitive I can use ABS

and from possitive to negative ?

Thanks
0
Comment
Question by:hidrau
  • 2
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
rfwoolf earned 500 total points
ID: 20335699
0 - 145.74 ?
0
 
LVL 19

Expert Comment

by:MerijnB
ID: 20335707
var d: double;
begin
 d := 145.74;
 d := d * -1;
 // d is now -145.74
end;
0
 
LVL 13

Expert Comment

by:rfwoolf
ID: 20335762
Thanks. You could have waited a little longer before accecpting your solution, because MerijnB's answer is also correct. Let us know if you need anything else :)
0
 
LVL 19

Expert Comment

by:MerijnB
ID: 20336096
don't understand, how does rfwoolf's answer change a value from positive to negative :)

I guess I misunderstand the question... :?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
sumDigits  challenge 7 74
Delphi 2 47
Copy Files - Python 7 71
SUM 2 INTEGER ARRAYS INTO 1 10 93
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
The viewer will learn how to implement Singleton Design Pattern in Java.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now