-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
240 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/**************************************************************************** | ||
* | ||
* Open Watcom Project | ||
* | ||
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. | ||
* | ||
* ======================================================================== | ||
* | ||
* This file contains Original Code and/or Modifications of Original | ||
* Code as defined in and that are subject to the Sybase Open Watcom | ||
* Public License version 1.0 (the 'License'). You may not use this file | ||
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO | ||
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is | ||
* provided with the Original Code and Modifications, and is also | ||
* available at www.sybase.com/developer/opensource. | ||
* | ||
* The Original Code and all software distributed under the License are | ||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM | ||
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR | ||
* NON-INFRINGEMENT. Please see the License for the specific language | ||
* governing rights and limitations under the License. | ||
* | ||
* ======================================================================== | ||
* | ||
* Description: Ceiling routine. | ||
* | ||
****************************************************************************/ | ||
|
||
|
||
#include "variety.h" | ||
#include <math.h> | ||
|
||
|
||
_WMRTLINK double ceil( double x ) | ||
/*******************************/ | ||
{ | ||
return( -floor( -x ) ); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/**************************************************************************** | ||
* | ||
* Open Watcom Project | ||
* | ||
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. | ||
* | ||
* ======================================================================== | ||
* | ||
* This file contains Original Code and/or Modifications of Original | ||
* Code as defined in and that are subject to the Sybase Open Watcom | ||
* Public License version 1.0 (the 'License'). You may not use this file | ||
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO | ||
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is | ||
* provided with the Original Code and Modifications, and is also | ||
* available at www.sybase.com/developer/opensource. | ||
* | ||
* The Original Code and all software distributed under the License are | ||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM | ||
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR | ||
* NON-INFRINGEMENT. Please see the License for the specific language | ||
* governing rights and limitations under the License. | ||
* | ||
* ======================================================================== | ||
* | ||
* Description: Floating-point floor routine. | ||
* | ||
****************************************************************************/ | ||
|
||
|
||
#include "variety.h" | ||
#include <math.h> | ||
|
||
|
||
_WMRTLINK double floor( double x ) | ||
/********************************/ | ||
{ | ||
double ipart; | ||
double fraction; | ||
|
||
fraction = modf( x, &ipart ); | ||
if( fraction < 0.0 ) { | ||
ipart -= 1.0; | ||
} | ||
return( ipart ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/**************************************************************************** | ||
* | ||
* Open Watcom Project | ||
* | ||
* Portions Copyright (c) 2014 Open Watcom contributors. | ||
* All Rights Reserved. | ||
* | ||
* ======================================================================== | ||
* | ||
* This file contains Original Code and/or Modifications of Original | ||
* Code as defined in and that are subject to the Sybase Open Watcom | ||
* Public License version 1.0 (the 'License'). You may not use this file | ||
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO | ||
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is | ||
* provided with the Original Code and Modifications, and is also | ||
* available at www.sybase.com/developer/opensource. | ||
* | ||
* The Original Code and all software distributed under the License are | ||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM | ||
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR | ||
* NON-INFRINGEMENT. Please see the License for the specific language | ||
* governing rights and limitations under the License. | ||
* | ||
* ======================================================================== | ||
* | ||
* Description: Returns the larger of x and y | ||
* | ||
****************************************************************************/ | ||
|
||
#include "variety.h" | ||
#include <math.h> | ||
|
||
_WMRTLINK double fmax(double x, double y) | ||
{ | ||
if(x >= y) | ||
return x; | ||
else | ||
return y; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/**************************************************************************** | ||
* | ||
* Open Watcom Project | ||
* | ||
* Portions Copyright (c) 2014 Open Watcom contributors. | ||
* All Rights Reserved. | ||
* | ||
* ======================================================================== | ||
* | ||
* This file contains Original Code and/or Modifications of Original | ||
* Code as defined in and that are subject to the Sybase Open Watcom | ||
* Public License version 1.0 (the 'License'). You may not use this file | ||
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO | ||
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is | ||
* provided with the Original Code and Modifications, and is also | ||
* available at www.sybase.com/developer/opensource. | ||
* | ||
* The Original Code and all software distributed under the License are | ||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM | ||
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR | ||
* NON-INFRINGEMENT. Please see the License for the specific language | ||
* governing rights and limitations under the License. | ||
* | ||
* ======================================================================== | ||
* | ||
* Description: Returns the smaller of x and y | ||
* | ||
****************************************************************************/ | ||
|
||
#include "variety.h" | ||
#include <math.h> | ||
|
||
_WMRTLINK double fmin(double x, double y) | ||
{ | ||
if(x <= y) | ||
return x; | ||
else | ||
return y; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/**************************************************************************** | ||
* | ||
* Open Watcom Project | ||
* | ||
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. | ||
* | ||
* ======================================================================== | ||
* | ||
* This file contains Original Code and/or Modifications of Original | ||
* Code as defined in and that are subject to the Sybase Open Watcom | ||
* Public License version 1.0 (the 'License'). You may not use this file | ||
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO | ||
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is | ||
* provided with the Original Code and Modifications, and is also | ||
* available at www.sybase.com/developer/opensource. | ||
* | ||
* The Original Code and all software distributed under the License are | ||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM | ||
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR | ||
* NON-INFRINGEMENT. Please see the License for the specific language | ||
* governing rights and limitations under the License. | ||
* | ||
* ======================================================================== | ||
* | ||
* Description: Base 10 logarithm routine. | ||
* | ||
****************************************************************************/ | ||
|
||
|
||
#include "variety.h" | ||
#include "mathlib.h" | ||
#include "ifprag.h" | ||
|
||
|
||
#define log10_of_e 0.4342944819032518 | ||
|
||
|
||
_WMRTLINK float _IF_log10( float x ) | ||
/**********************************/ | ||
{ | ||
return( _IF_dlog10( x ) ); | ||
} | ||
|
||
_WMRTLINK double (log10)( double x ) | ||
/**********************************/ | ||
{ | ||
return( _IF_dlog10( x ) ); | ||
} | ||
|
||
_WMRTLINK double _IF_dlog10( double x ) | ||
/*************************************/ | ||
{ | ||
if( x <= 0.0 ) { | ||
x = __log_matherr( x, FP_FUNC_LOG10 ); | ||
} else { | ||
x = log(x) * log10_of_e; | ||
} | ||
return( x ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters