Re: Positive Zahlen in negative umwandeln
Zitat:
-.- falls man nicht weiß, obs neg / pos ist und es unbedingt neg. sein muss dann: Zitat:
Code:
Zahl := -abs( Zahl + Zahl*2 + Zahl*3 - Zahl*7 );
|
Re: Positive Zahlen in negative umwandeln
Was auch noch sicherstellt, dass man immer ein negatives Ergebis bekommt:
Delphi-Quellcode:
:lol:
zahl := (sqrt(Power(zahl, 2)) * (-6)) / 6
|
Re: Positive Zahlen in negative umwandeln
falls man nicht weiß, obs neg / pos ist und es unbedingt neg. sein muss dann:
Code:
[/quote]
if zahl >= 0 then
zahl := -zahl;
Delphi-Quellcode:
:-D
zahl := -abs(zahl);
|
Re: Positive Zahlen in negative umwandeln
Zitat:
|
Re: Positive Zahlen in negative umwandeln
Delphi-Quellcode:
Zahl := Succ(Zahl xor (1 shl Pred(SizeOf(Integer) shl 3) + MAXINT));
|
Re: Positive Zahlen in negative umwandeln
Zitat:
vielleicht der:
Delphi-Quellcode:
zahl := zahl * round(cos(180));
|
Re: Positive Zahlen in negative umwandeln
Zitat:
Gruß -- |
Re: Positive Zahlen in negative umwandeln
[OT]
...selten so gelacht :mrgreen: ...unabhängig davon führen viele Wege nach Rom :thumb: [/OT] |
Re: Positive Zahlen in negative umwandeln
Zitat:
|
Re: Positive Zahlen in negative umwandeln
Zitat:
Delphi-Quellcode:
:-D[/quote]
zahl := -abs(zahl);
hatte ich eh so gemeint :P |
Alle Zeitangaben in WEZ +1. Es ist jetzt 13:18 Uhr. |
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