summaryrefslogtreecommitdiff
path: root/lib/libm
AgeCommit message (Collapse)Author
2011-04-28fenv improvements and cleanupsMartynas Venckus
2011-04-26fenv for mips64Martynas Venckus
2011-04-25fenv for sparc; mostly cloned from sparc64Martynas Venckus
2011-04-25fenv for powerpcMartynas Venckus
2011-04-24fenv for shMartynas Venckus
2011-04-24fenv for i386, and sparc64; from matthew@Martynas Venckus
not reviewed yet, but it's better to track changes in cvs
2011-04-24fenv for armMartynas Venckus
2011-04-23Implement C99 floating-point environment for Alpha.Martynas Venckus
Delivering FPE with non-masked exceptions doesn't work on Alpha; I suspect there's a bug in the kernel trap handler. FE_INEXACT is intentionally left out of FE_ALL_EXCEPT; since the inexact exception is not being maintained. Otherwise it will lead to the bogus results.
2011-04-21fenv for amd64; from matthew@Martynas Venckus
feedback & ok guenther@, matthew@
2011-04-21fenv for hppaMartynas Venckus
2011-04-20fenv for m68kMartynas Venckus
2011-04-20Trick GCC optimizer into clipping any extra precision by making wMartynas Venckus
volatile; a similar hack was already being used in lrintf(). This will make rint and {,l}lrint family functions actually work; i.e. on m68k rintf(8.6F) was 8.625.
2011-04-17The {,l}lround{,f} implementations are based on {,l}lrint{,f},Martynas Venckus
therefore affected by the same bugs I've fixed a week ago. The high part was being clipped for all exponents greater or equal to 52. Fix this to use RESTYPE_BITS instead; also make the code consistent.
2011-04-1720 -> DBL_FRACHBITSMartynas Venckus
2011-04-16Document what happens when x equals y.Martynas Venckus
2011-04-16C99: "The nextafter functions return y if x equals y."Martynas Venckus
Therefore, in nextafter() and nextafterf(): - if(x==y) return x; /* x=y, return x */ - if(x==y) return y; /* x=y, return y */ This matters for negative zero inputs of x or y.
2011-04-10The {,l}lrint{,f} functions avoid to shift results by more than 31Martynas Venckus
bits, because "behavior is implementation defined in this case". However, this is wrong; behavior is undefined if the right operand is greater than or equal to the width of the promoted left operand. This broke {,l}lrint{,f} (64-bit architectures), and llrint{,f} (32-bit architectures) where results are actually 64-bit values. The high part was clipped for all exponents greater or equal to 52. Fix this to use RESTYPE_BITS instead; {,l}lrint{,f} are now able to pass our regression tests, and I think are right now.
2011-04-1020 -> DBL_FRACHBITSMartynas Venckus
2011-04-10The assumption that |1.0 * 2^exp| = 0, exp < -1 cannot be made whenMartynas Venckus
we round towards -inf or +inf.
2010-07-19Add barebones manual pages for cimag(3), conj(3) and cproj(3)Todd C. Miller
OK kettenis@ jmc@
2010-07-19Fix the cproj family to not return garbage on finite arguments.Philip Guenthe
ok millert@
2010-07-18Use crealf() and cimagf() instead of creal() and cimag() when thePhilip Guenthe
argument is a float. Eliminate a cast rendered superfluous as a result. ok kettenis@, millert@
2010-06-03typo in a commentTheo de Raadt
2010-05-05Tweak inline asm to prevent gcc4 from optimizing away crucial bits of it.Mark Kettenis
ok miod@
2010-03-26dispense with some wacky escape sequences;Jason McIntyre
2010-02-20Multiple issues were killing the build with mandoc(1), thus:Ingo Schwarze
* do not use low-level roff macros like .if and .ds * add the missing .Os to the preamble * move unqualified text out of .Bl ok jmc@
2010-02-03Use MACHINE_CPU instead of MACHINE_ARCH to pick the correct machine dependentMiod Vallat
files or directories when applicable. The inspiration and name of MACHINE_CPU come from NetBSD, although the way to provide it to Makefiles is completely different. ok kettenis@
2009-11-06Provide assembly version of sqrtl(3).Mark Kettenis
ok pirofti@
2009-11-05Provide assembly version of sqrtl(3).Mark Kettenis
ok otto@
2009-10-28rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andTheo de Raadt
unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
2009-10-27reorder the log functions slightly; from thomas pfaffJason McIntyre
2009-10-26Add man pages for the fdim/fmin/fmax family of functions and make sure fdimlMark Kettenis
is defined on all architectures. ok jmc@ (man pages) and martynas@
2009-10-24document log2() and log2f(); from thomas pfaffJason McIntyre
ok otto millert martynas
2009-08-03remove, or replace Xr of ieee to either ilogb, nextafter or scalbnMartynas Venckus
where appropriate. pointed out by jmc@
2009-07-29now that the pages are split and we track separate HISTORY:Martynas Venckus
double => 4.3BSD float => NetBSD 1.1 long double => OpenBSD 4.5 scalbln, scalblnf, scalblnl => OpenBSD 4.7
2009-07-29ieee, and ieeef aren't real, and the amount of functions it documentsMartynas Venckus
is getting ridiculous. split them into groups of copysign, ilogb, nextafter, scalbn. discussed long ago with millert@
2009-07-29ieee_test isn't real; rename header to logb, tooMartynas Venckus
2009-07-28document scalbln, scalblnf, scalblnlMartynas Venckus
2009-07-25int is big enough to fully represent exponents of all supported fpMartynas Venckus
formats. which even for 80-bit & 128-bit long doubles is only 15 bits. therefore, scalbln, scalblnf, scalblnl are essentially the same as scalbn, scalbnf, scalbnl with bounds checking so that LONG_MIN..INT_MIN, and INT_MAX..LONG_MAX ranges properly raise exceptions & yield correct values. looks good to millert@
2009-07-15round, roundf, trunc, truncf for hppa; ok kettenis@Martynas Venckus
2009-07-06fe_towardzero not on openbsd. ok millert@Martynas Venckus
2009-06-30floor(3) should round towards -inf instead of towards zero.Mark Kettenis
ok martynas@, deraadt@
2009-04-25fix scalbn, scalbnf, frexpf on amd64. don't use double argMartynas Venckus
float/double prologue/epilogue, since the second argument is not float/double. were never working properly (always returned inf). actually, should help other math funcs (like pow) too, since they use it internally tested by kurt@; devel/boost fp regresses are working better now. ok kurt@
2009-04-21alias and give frexpf symbol external linkage to scalbnf; this wasMartynas Venckus
overriden by md source. spotted by kurt@ actually; on amd64 scalbnf, scalbn (and therefore now frexpf) have always been broken since second argument is not float. fix is under reviewal / will be committed separately ok kurt@, kettenis@, millert@. tested by kurt@
2009-04-19make ldexpf behavior consistent with the double and extended-precisionMartynas Venckus
versions; spotted by kettenis@ while here also remove unused ldexp; it lives in libc ok kettenis@, "looks good" millert@
2009-04-11in the old days compiler could not convert decimal constantsMartynas Venckus
accurately, hence the tricks in libm, using machine representation of constants. remove kludges and switch to use decimal constants, much simplifying the code. since, the compiler converts them accurately. generated values match on vaxfp discussed with millert@, and miod@ testing todd@, and myself ok millert@
2009-04-10lrint, llrint, lrintf, llrintf for amd64. ok kettenis@, oga@Martynas Venckus
2009-04-08missing rcs ids; spacingMartynas Venckus
2009-04-08remove i386/x86_64 ifdefs. i386 lives @ i387. miod@ agreesMartynas Venckus
object code matches so this got to be oki
2009-04-08fix hexadecimal constant that was wrong; and confused with ieee. ok miod@Martynas Venckus