Skip to content

Commit

Permalink
[owc libc] Cleanup math library source a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaerr committed Mar 5, 2025
1 parent 46790af commit 8716ed5
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 15 deletions.
4 changes: 0 additions & 4 deletions libc/watcom/math/fmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@
#include <math.h>
//#include "_matherr.h"

#ifdef __ELKS__
#define __reporterror(a,b,c,d,e) assert(0)
#endif


/* The fmod function computes the floating-point remainder of x/y.
It returns x if y is 0, otherwise it returns the value f that has
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions libc/watcom/math/ldexp.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@

#include "variety.h"
#include <math.h>

#include "mathlib.h"
//#include "clibsupp.h"
extern void __set_ERANGE( void );


_WMRTLINK double ldexp( double value, int n )
Expand Down
1 change: 1 addition & 0 deletions libc/watcom/math/math2err.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ _WMRTLINK double __math2err( unsigned int err_info, double *arg1, double *arg2 )
{
#ifdef __ELKS__
assert(0);
return 0;
#else
int why;
struct exception exc;
Expand Down
2 changes: 2 additions & 0 deletions libc/watcom/math/mathlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#include "cplx.h"
#include "mathcode.h"

#define __reporterror(a,b,c,d,e) assert(0)
extern void __set_ERANGE( void );

#if !defined(_M_IX86) || defined(__FLAT__)
typedef double *m_dbl_stk_ptr;
Expand Down
2 changes: 0 additions & 2 deletions libc/watcom/math/pow.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
#include <limits.h>
#include "mathlib.h"
#include "ifprag.h"

//#include "clibsupp.h"
extern void __set_ERANGE( void );

_WMRTLINK float _IF_pow( float x, float y )
/*****************************************/
Expand Down
5 changes: 1 addition & 4 deletions libc/watcom/math/round.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,9 @@
#include <assert.h>
#include "variety.h"
#include <math.h>
#include "mathlib.h"
//#include "_matherr.h"

#ifdef __ELKS__
#define __reporterror(a,b,c,d,e) assert(0)
#endif

_WMRTLINK double round(double x)
{
double y;
Expand Down
4 changes: 1 addition & 3 deletions libc/watcom/math/sincos.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@
#include "mathlib.h"
#include "ifprag.h"
//#include "rtdata.h"
#include "pi.h"

//#include "clibsupp.h"
extern void __set_ERANGE( void );
#include "pi.h"

static const double _sinpoly[] = {
1.0 / (2.*3*4*5*6*7*8*9*10*11*12*13*14*15*16*17),
Expand Down

0 comments on commit 8716ed5

Please sign in to comment.