Solved

# how to change a possitive value to negative

Posted on 2007-11-22
158 Views
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
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
• 2
• 2

LVL 13

Accepted Solution

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

LVL 19

Expert Comment

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

LVL 13

Expert Comment

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

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

Question has a verified solution.

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

### Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This article will show, step by step, how to integrate R code into a R Sweave document
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Botâ€¦
###### Suggested Courses
Course of the Month8 days, 20 hours left to enroll