Commit Graph

152 Commits

Author SHA1 Message Date
florian
2932787dee * use SizeInt for counters in math unit, all non-32 bit targets should benefit from this
git-svn-id: trunk@48815 -
2021-02-26 22:47:06 +00:00
florian
4c1978c131 * reported by Bart on the mailing list: insert empty line to make clear to which function the comment applies
git-svn-id: trunk@46972 -
2020-09-27 13:05:36 +00:00
michael
a49c469a5d * Fix defines for fpdoc
git-svn-id: trunk@46763 -
2020-09-04 15:19:28 +00:00
florian
cd35cdad25 * fix Min/MaxSingle/Double values, resolves #36870
git-svn-id: trunk@44714 -
2020-04-13 08:48:32 +00:00
florian
b8f186dab2 * reverted r43366
git-svn-id: trunk@43382 -
2019-11-03 14:42:02 +00:00
florian
5ead23513d * more overloads for Math.Min/Max, resolves #36161
git-svn-id: trunk@43366 -
2019-11-02 16:21:43 +00:00
michael
863ede7dc6 * Add QWord version of Max (Delphi compatibility, bug ID #34364)
git-svn-id: trunk@39995 -
2018-10-20 12:28:56 +00:00
michael
ab159c638c * Move consts to stdconv
git-svn-id: trunk@39994 -
2018-10-20 12:18:16 +00:00
michael
407753ea10 * Add constants for powers of 10 and 2. use integer/int64 where possible
git-svn-id: trunk@39992 -
2018-10-20 10:40:12 +00:00
florian
a825a66d01 * IntPower inverts the base first for negative exponents and multiplies then, resolves #34124
git-svn-id: trunk@39621 -
2018-08-16 20:45:35 +00:00
svenbarth
8a195c44ba + add overloads of IsInfinite() for Single and Extended (compatible with Delphi)
git-svn-id: trunk@39135 -
2018-05-28 15:36:18 +00:00
michael
e46b89c8bb * Patch from Ondrej Pokorny to fix camelcase (bug ID 4b46872)
git-svn-id: trunk@38619 -
2018-03-24 14:39:56 +00:00
michael
16ba47be46 * Patch from Ondrej Pokorny to convert unit names to CamelCase (bug ID 33481)
git-svn-id: trunk@38616 -
2018-03-23 22:06:36 +00:00
florian
8a2cf56d51 * fixed operator mod for floats as proposed by wp in #33167, resolves #33167
git-svn-id: trunk@38332 -
2018-02-24 18:23:06 +00:00
michael
fb7d2d9ebd * Patch from Anton Shepelev to fix variance and standard deviation calculation (bug ID 32804)
git-svn-id: trunk@37791 -
2017-12-24 10:02:02 +00:00
marco
a5487d327f * intmean, patch by Bart. Bug #32661
git-svn-id: trunk@37688 -
2017-12-06 10:30:02 +00:00
michael
bb79ab787e * Fix FULLVERSION check for randomfrom
git-svn-id: trunk@36718 -
2017-07-10 09:58:36 +00:00
michael
162b938409 * Patch from Thaddy De Koning to add generic RandomFrom
git-svn-id: trunk@36706 -
2017-07-09 10:11:01 +00:00
nickysn
958d74e41c - removed the "else" in math.EnsureRange, because this way the compiler
generates entirely branchless code (via CMOVxx) on Pentium II or later (when
  compiling with -CpPENTIUM2)

git-svn-id: trunk@36305 -
2017-05-23 13:17:28 +00:00
florian
69f41a776e * jump-free Ceil*/Floor* implementations
git-svn-id: trunk@36283 -
2017-05-21 12:34:31 +00:00
michael
c3e50a36cc * Move fpdoc block after uses clause
git-svn-id: trunk@35398 -
2017-02-05 09:51:43 +00:00
Károly Balogh
6dff85df58 math: replace trunc() with int() in some functions working with floats to avoid some unnecessary int64->double conversions, as trunc returns an integer, which then has to be converted back to float
git-svn-id: trunk@34995 -
2016-11-27 18:08:32 +00:00
Károly Balogh
5c87e870fd tabs to spaces fix, no functional changes
git-svn-id: trunk@34994 -
2016-11-27 17:59:41 +00:00
michael
18f2592433 * float version of modulo (Patch from Thaddy De koning, bug ID #30744)
git-svn-id: trunk@34968 -
2016-11-26 16:57:34 +00:00
michael
364abc3c07 * Author retracted erf/erfc functions due to copyright issues
git-svn-id: trunk@33130 -
2016-02-28 08:27:01 +00:00
michael
3da0f82995 * Add error functions erf/erfc, bug ID #29740
git-svn-id: trunk@33128 -
2016-02-27 14:59:51 +00:00
sergei
161f812113 * Explicitly typecast (-longint) to longint, otherwise it becomes an int64 on 64-bit targets, causing wrong result of sign(longint). Mantis #29649.
git-svn-id: trunk@33096 -
2016-02-14 10:29:11 +00:00
sergei
9b84581f4c + function copysign(x,y), calculates abs(x)*sign(y), private for unit math (not in interface).
* fixed sinh and arsinh return values at -0.0 and -Inf.

git-svn-id: trunk@33069 -
2016-02-07 15:34:02 +00:00
sergei
a4ed9f3b54 * Improved sign(x) functions to be branchless in most cases. Resolves #14206.
git-svn-id: trunk@33067 -
2016-02-07 11:18:31 +00:00
michael
88957c62e3 * Add Ceil64 and Floor64, patch from Bart Broersma (bug ID 28370)
git-svn-id: trunk@32766 -
2015-12-27 17:25:06 +00:00
michael
b9fa0d0934 * Mimic minfloat for fpdoc
git-svn-id: trunk@31036 -
2015-06-13 16:37:33 +00:00
michael
bb7e0f645f * Fake some types when running under FPDOC
git-svn-id: trunk@31034 -
2015-06-13 16:23:56 +00:00
marco
3a7cde492e * finance functions by wp, mantis #26459
git-svn-id: trunk@28182 -
2014-07-08 12:45:11 +00:00
sergei
f767d9017c * Fixed sin(-0.0) to return -0.0 (was returning 0.0)
* Fixed lnxp1(-1.0) to return -Inf (was returning NaN)

git-svn-id: trunk@27639 -
2014-04-23 10:03:18 +00:00
sergei
57c762c8d2 + Inserted license header for AMath routines.
git-svn-id: trunk@27552 -
2014-04-12 20:45:44 +00:00
sergei
bd58adfcc9 + Added credits for functions reused from AMath/DAMath libraries.
git-svn-id: trunk@27518 -
2014-04-10 20:29:49 +00:00
michael
d45ced0221 * Added DegNormalize
git-svn-id: trunk@27492 -
2014-04-06 16:37:43 +00:00
sergei
94a045aa3d * Moved declarations of TFPURoundingMode,TFPUExceptionMask and TFPUPrecisionMode to System unit. Declarations in Math unit changed to aliases.
* Changed type of softfloat_exception_mask and softfloat_exception_flags to TFPUExceptionMask, softfloat_rounding_mode to TFPURoundingMode.
- Cleaned out numerous conversions happening when getting/setting exception mask and rounding mode.

git-svn-id: trunk@27215 -
2014-03-20 22:44:46 +00:00
sergei
0255eb880e - Removed mathuh.inc files which are identical for all targets (except m68k, see below), their contents moved into math.pp.
+ m68k/mathu.inc: added stub implementations for missing functions.

git-svn-id: trunk@27180 -
2014-03-18 20:01:15 +00:00
nickysn
19a39cde4a * 16-bit objpas.integer type fixes in Math.DivMod
git-svn-id: trunk@27052 -
2014-03-09 16:46:49 +00:00
nickysn
4eb9043ac7 * x87 optimized version of math.log2() for i8086, i386 and x86_64
git-svn-id: trunk@26266 -
2013-12-22 23:21:41 +00:00
nickysn
90b69184f1 * use a {$if defined()} sequence, instead of nested ifdefs for selecting the
float type in unit math

git-svn-id: trunk@26265 -
2013-12-22 19:18:15 +00:00
sergei
141b2f7066 * arcsin and arccos: improve accuracy at small arguments by replacing sqr(1-x*x) with sqr((1-x)*(1+x)).
* arcosh: likewise, error near 1.0 decreases approx. from 80*eps to 4*eps.
* artahn: improve accuracy by replacing ln(x+1) with lnxp1(x).

git-svn-id: trunk@26091 -
2013-11-14 18:26:34 +00:00
sergei
636736dda6 * log2() and log10(): replaced division by ln(base) with multiplication by reciprocal constant, this executes faster and somehow provides slightly better accuracy.
git-svn-id: trunk@26086 -
2013-11-14 08:22:28 +00:00
sergei
c7213b7ff1 - Math unit: don't raise EInvalidArgument exception in general math functions, this is Delphi-compatible. Delphi raises EInvalidArgument only in statistical/financial functions; general math functions execute code which causes EInvalidOp raised by hardware (or low-level system routines).
git-svn-id: trunk@26085 -
2013-11-14 07:49:38 +00:00
sergei
5206584805 * lnxp1 function fixed to be accurate near zero argument values, using code from AMath library by Wolfgang Ehrhardt.
git-svn-id: trunk@26084 -
2013-11-14 07:03:11 +00:00
sergei
437b3755d1 * math.hypot(): factor larger argument out of expression in order to avoid loss of precision.
git-svn-id: trunk@26026 -
2013-11-11 09:56:20 +00:00
sergei
d981861433 * IsNan(single): can be written much simpler, because representation of single casted to longint is the same on big-endian and little-endian targets.
git-svn-id: trunk@25554 -
2013-09-24 18:55:44 +00:00
florian
1da4c0c3ce * SinCos overloads added, resolves #22663
git-svn-id: trunk@22139 -
2012-08-19 22:09:03 +00:00
florian
2677187b2f * inline several math methods (though a lot won't be inlined yet because they take open array parameters), resolves #21040
* more compact formatting (removed empty lines)
* remove call to invalid argument in arctanh, arccosh doesn't have it either

git-svn-id: trunk@20936 -
2012-04-19 21:14:09 +00:00