src/JavaMathSupport.st
author vranyj1
Wed, 23 Nov 2011 15:26:06 +0000
branchjk_new_structure
changeset 1152 040cba55a7d2
parent 990 5e4818e67471
child 1155 d6f6d5fc0343
permissions -rw-r--r--
Copyright fixes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
987
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
     1
"
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
     2
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 990
diff changeset
     3
040cba55a7d2 Copyright fixes
vranyj1
parents: 990
diff changeset
     4
 New code and modification done at SWING Research Group [1]:
040cba55a7d2 Copyright fixes
vranyj1
parents: 990
diff changeset
     5
987
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
     6
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
     7
                            SWING Research Group, Czech Technical University in Prague
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
     8
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
     9
 Parts of the code written by Claus Gittinger are under following
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    10
 license:
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    11
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    12
 This software is furnished under a license and may be used
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    13
 only in accordance with the terms of that license and with the
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    14
 inclusion of the above copyright notice.   This software may not
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    15
 be provided or otherwise made available to, or used by, any
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    16
 other person.  No title to or ownership of the software is
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    17
 hereby transferred.
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    18
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    19
 [1] Code written at SWING Research Group contain a signature
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 990
diff changeset
    20
     of one of the above copright owners. For exact set of such code
040cba55a7d2 Copyright fixes
vranyj1
parents: 990
diff changeset
    21
     see the differences between this version and version stx:lib
040cba55a7d2 Copyright fixes
vranyj1
parents: 990
diff changeset
    22
     as of 1.9.2010
987
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    23
"
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    24
"{ Package: 'stx:libjava' }"
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    25
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    26
Object subclass:#JavaMathSupport
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    27
	instanceVariableNames:''
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    28
	classVariableNames:''
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    29
	poolDictionaries:''
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    30
	category:'Languages-Java-Support-Native'
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    31
!
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    32
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    33
!JavaMathSupport class methodsFor:'documentation'!
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    34
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    35
copyright
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    36
"
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    37
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 990
diff changeset
    38
040cba55a7d2 Copyright fixes
vranyj1
parents: 990
diff changeset
    39
 New code and modification done at SWING Research Group [1]:
040cba55a7d2 Copyright fixes
vranyj1
parents: 990
diff changeset
    40
987
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    41
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    42
                            SWING Research Group, Czech Technical University in Prague
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    43
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    44
 Parts of the code written by Claus Gittinger are under following
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    45
 license:
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    46
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    47
 This software is furnished under a license and may be used
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    48
 only in accordance with the terms of that license and with the
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    49
 inclusion of the above copyright notice.   This software may not
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    50
 be provided or otherwise made available to, or used by, any
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    51
 other person.  No title to or ownership of the software is
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    52
 hereby transferred.
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    53
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    54
 [1] Code written at SWING Research Group contain a signature
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 990
diff changeset
    55
     of one of the above copright owners. For exact set of such code
040cba55a7d2 Copyright fixes
vranyj1
parents: 990
diff changeset
    56
     see the differences between this version and version stx:lib
040cba55a7d2 Copyright fixes
vranyj1
parents: 990
diff changeset
    57
     as of 1.9.2010
987
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    58
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    59
"
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    60
! !
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    61
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    62
!JavaMathSupport class methodsFor:'java-style FP functions'!
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    63
990
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
    64
cos:f
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
    65
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
    66
%{
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
    67
	RETURN ( _MKFLOAT( jcos ( __floatVal ( f ) ) ) );
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
    68
%}
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
    69
988
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
    70
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
    71
    "Created: / 07-09-2011 / 17:34:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
    72
!
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
    73
987
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    74
cosh: f
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    75
988
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
    76
%{
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
    77
	RETURN ( _MKFLOAT( jcosh ( __floatVal ( f ) ) ) );
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
    78
%}
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
    79
987
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    80
    "Created: / 07-09-2011 / 17:08:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    81
!
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
    82
990
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
    83
expm1:f
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
    84
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
    85
%{
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
    86
	RETURN ( _MKFLOAT( jexpm1 ( __floatVal ( f ) ) ) );
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
    87
%}
988
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
    88
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
    89
    "Created: / 07-09-2011 / 17:34:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
    90
!
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
    91
990
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
    92
floor:f
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
    93
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
    94
%{
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
    95
	RETURN ( _MKFLOAT( jfloor ( __floatVal ( f ) ) ) );
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
    96
%}
988
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
    97
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
    98
    "Created: / 07-09-2011 / 17:33:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
    99
!
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
   100
990
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
   101
sin:f
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
   102
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
   103
%{
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
   104
	RETURN ( _MKFLOAT( jsin ( __floatVal ( f ) ) ) );
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
   105
%}
988
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
   106
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
   107
    "Created: / 07-09-2011 / 17:32:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
   108
!
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
   109
987
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
   110
sinh: f
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
   111
988
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
   112
%{
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
   113
	RETURN ( _MKFLOAT( jsinh ( __floatVal ( f ) ) ) );
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
   114
%}
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
   115
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
   116
987
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
   117
    "Created: / 07-09-2011 / 17:08:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
988
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
   118
!
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
   119
990
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
   120
tanh:f
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
   121
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
   122
%{
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
   123
	RETURN ( _MKFLOAT( jtanh ( __floatVal ( f ) ) ) );
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
   124
%}
5e4818e67471 Build files fixed, JavaMathSupport improved
vranyj1
parents: 988
diff changeset
   125
988
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
   126
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 987
diff changeset
   127
    "Created: / 07-09-2011 / 17:32:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
987
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
   128
! !
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
   129
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
   130
!JavaMathSupport class methodsFor:'documentation'!
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
   131
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
   132
version_SVN
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
   133
    ^ '$Id$'
7ce13ad78d68 - build targets for building fdlibm
vranyj1
parents:
diff changeset
   134
! !