Delphi-PRAXiS
Seite 1 von 22  1 2311     Letzte »    

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Positive Zahlen in negative umwandeln (https://www.delphipraxis.net/123215-positive-zahlen-negative-umwandeln.html)

Larsi 29. Okt 2008 17:07


Positive Zahlen in negative umwandeln
 
Hi,
wie kann ich beispielsweise die positive Zahl 40 in - 40 machen. In Delphi?

Die Muhkuh 29. Okt 2008 17:08

Re: Positive Zahlen in negative umwandeln
 
:mrgreen:

Wie machst Du es normal in Mathematik?

DeddyH 29. Okt 2008 17:08

Re: Positive Zahlen in negative umwandeln
 
Ist das Dein Ernst?
Delphi-Quellcode:
Zahl := -abs(Zahl);
Das ist auf jeden Fall negativ.

nahpets 29. Okt 2008 17:08

Re: Positive Zahlen in negative umwandeln
 
* -1
oder
Delphi-Quellcode:
StrToInt('-' + IntToStr(40))
:wink:

Dunkel 29. Okt 2008 17:10

Re: Positive Zahlen in negative umwandeln
 
oder Zahl := Zahl - (Zahl * 2);

The Riddler 29. Okt 2008 17:14

Re: Positive Zahlen in negative umwandeln
 
Oder:
Delphi-Quellcode:
Zahl := ((((Zahl * 350) * -1000) / 350) / 1000)

DeddyH 29. Okt 2008 17:15

Re: Positive Zahlen in negative umwandeln
 
Delphi-Quellcode:
Zahl := Zahl * -Sign(Zahl);

Roachford 29. Okt 2008 17:20

Re: Positive Zahlen in negative umwandeln
 
Delphi-Quellcode:
zahl := -zahl;

Die Muhkuh 29. Okt 2008 17:21

Re: Positive Zahlen in negative umwandeln
 
Herrlich :mrgreen:

The Riddler 29. Okt 2008 17:25

Re: Positive Zahlen in negative umwandeln
 
Delphi-Quellcode:
Zahl := Zahl - (4 * Zahl / 2);


Alle Zeitangaben in WEZ +1. Es ist jetzt 07:39 Uhr.
Seite 1 von 22  1 2311     Letzte »    

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz