Vote UpVote

Doubling Down - Fixing Min/Max() for Doubles

TPersistent.com – Today I discovered that the built-in overload for Min() and Max() double in the Math unit do not always work as expected.  If you search on how to compare floating point types there are many StackOverflow answers, none of which have been adopted over the years by the built-in library.  I have come across this issue of the comparison of floating type values more than once, but keep forgetting not to use built-in functions.  I discovered that the code I was using to determine the range of values was failing on MyX := Max(MinDouble,0); MyX was not 0 as expected, so I created a new Math unit ...
Favorite? Off-Topic? Larry Hengen @ 2019-09-17 20:04


Visits: 133
Votes: 1
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Michał Rajewicz
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News


Please login or register to use this functionality.
(click on this box to dismiss)