AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

floats auf Null prüfen (C++)

Ein Thema von SnuffMaster23 · begonnen am 3. Apr 2008 · letzter Beitrag vom 5. Apr 2008
 
busybyte

Registriert seit: 15. Sep 2006
165 Beiträge
 
#2

Re: floats auf Null prüfen (C++)

  Alt 4. Apr 2008, 00:38
RoundTo Routine

Rounds a floating-point value to a specified digit or power of ten using "Banker's rounding".

Unit
Math

Syntax


[Delphi] function RoundTo(const AValue: Double; const ADigit: TRoundToRange): Double;


Description
Call RoundTo to round AValue to a specified power of ten.

AValue is the value to round.

ADigit indicates the power of ten to which you want AValue rounded. It can be any value from –37 to 37 (inclusive).

RoundTo uses "Banker's Rounding" to determine how to round values that are exactly midway between the two values that have the desired number of significant digits. This method rounds to an even number in the case that AValue is not nearer to either value.

The following examples illustrate the use of RoundTo:
Expression Value
RoundTo(1234567, 3)
1234000

RoundTo(1.234, -2)
1.23

RoundTo(1.235, -2)
1.24

RoundTo(1.245, -2)
1.24










SimpleRoundTo Routine

Rounds a floating-point value to a specified digit or power of ten using asymmetric arithmetic rounding.

Unit
Math

Syntax


[Delphi] function SimpleRoundTo(const AValue: Double; const ADigit: TRoundToRange): Double;


Description
Call SimpleRoundTo to round AValue to a specified power of ten.

AValue is the value to round.

ADigit indicates the power of ten to which you want AValue rounded. It can be any value from –37 to 37 (inclusive).

SimpleRoundTo uses asymmetric arithmetic rounding to determine how to round values that are exactly midway between the two values that have the desired number of significant digits. This method always rounds to the larger value.

The following examples illustrate the use of SimpleRoundTo:
Expression Value
SimpleRoundTo(1234567, 3)
1234000

SimpleRoundTo(1.234, -2)
1.23

SimpleRoundTo(1.235, -2)
1.24

SimpleRoundTo(-1.235, -2)
-1.23


Related Information
Math.RoundTo
I love DiscCat
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:41 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-2025 by Thomas Breitkreuz