Solved

how to change a possitive value to negative

Posted on 2007-11-22
4
155 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
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.

810 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