[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

how to change a possitive value to negative

Posted on 2007-11-22
4
Medium Priority
?
161 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
rfwoolf earned 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

656 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