![]() |
Aus negativ -> Positiv aus Positiv -> Negativ Funktion
Es gab doch eine Funktion in Delphi die aus Zahl (wenn das positive ist) eine Negative macht und andersrum, Wie heist die funktion?
Danke |
Re: Aus negativ -> Positiv aus Positiv -> Negativ Funk
Mir ist keine bekannt aber sich schnell eine selber schreiben, die den Wert mit -1 multipliziert, sollte nicht so schwer sein.
|
Re: Aus negativ -> Positiv aus Positiv -> Negativ Funk
Warum überhaupt eine Funktion?
Delphi-Quellcode:
Grüße vom marabu
zahl := - zahl;
|
Re: Aus negativ -> Positiv aus Positiv -> Negativ Funk
Zitat:
eher schon:
Delphi-Quellcode:
zahl := zahl * (-1);
|
Re: Aus negativ -> Positiv aus Positiv -> Negativ Funk
warum sollte
Delphi-Quellcode:
nicht funktionieren? :gruebel:
Zahl := -Zahl;
|
Re: Aus negativ -> Positiv aus Positiv -> Negativ Funk
Zitat:
Vor allem dieses hässliche * (-1)... ts, ts,... :roll: |
Re: Aus negativ -> Positiv aus Positiv -> Negativ Funk
Ich kenne mich praktisch 0 damit aus, aber die Methode mit - dürfte auch performanter sein, oder?
Sofern der Compiler da nicht umbastelt, würde ich behaupten, dass -1 berechnet wird, während bei - einfach nur das entsprechende Flag geändert wird *Behauptstung aufstell* ;) air |
Re: Aus negativ -> Positiv aus Positiv -> Negativ Funk
interessant dass ihr auf dem 2. niedrigsten niveau der mathematik rumdiskutiert *g*
ich bin auch für
Code:
zahl := -zahl;
Flare |
Alle Zeitangaben in WEZ +1. Es ist jetzt 22:14 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz