[823a929] | 1 | /*
|
---|
| 2 | * Copyright (c) 2011 Petr Koupy
|
---|
| 3 | * All rights reserved.
|
---|
| 4 | *
|
---|
| 5 | * Redistribution and use in source and binary forms, with or without
|
---|
| 6 | * modification, are permitted provided that the following conditions
|
---|
| 7 | * are met:
|
---|
| 8 | *
|
---|
| 9 | * - Redistributions of source code must retain the above copyright
|
---|
| 10 | * notice, this list of conditions and the following disclaimer.
|
---|
| 11 | * - Redistributions in binary form must reproduce the above copyright
|
---|
| 12 | * notice, this list of conditions and the following disclaimer in the
|
---|
| 13 | * documentation and/or other materials provided with the distribution.
|
---|
| 14 | * - The name of the author may not be used to endorse or promote products
|
---|
| 15 | * derived from this software without specific prior written permission.
|
---|
| 16 | *
|
---|
| 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
---|
| 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
| 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
---|
| 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
---|
| 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
---|
| 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
---|
| 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
---|
| 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
---|
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
| 27 | */
|
---|
| 28 |
|
---|
| 29 | /** @addtogroup libposix
|
---|
| 30 | * @{
|
---|
| 31 | */
|
---|
[4cf8ca6] | 32 | /** @file Mathematical operations.
|
---|
[823a929] | 33 | */
|
---|
| 34 |
|
---|
| 35 | #define LIBPOSIX_INTERNAL
|
---|
[fdf97f6] | 36 | #define __POSIX_DEF__(x) posix_##x
|
---|
[823a929] | 37 |
|
---|
| 38 | #include "internal/common.h"
|
---|
[a3da2b2] | 39 | #include "posix/math.h"
|
---|
[823a929] | 40 |
|
---|
| 41 | /**
|
---|
| 42 | *
|
---|
| 43 | * @param x
|
---|
| 44 | * @param exp
|
---|
| 45 | * @return
|
---|
| 46 | */
|
---|
| 47 | double posix_ldexp(double x, int exp)
|
---|
| 48 | {
|
---|
| 49 | // TODO: low priority, just a compile-time dependency of binutils
|
---|
| 50 | not_implemented();
|
---|
[820104d] | 51 | return 0.0;
|
---|
[823a929] | 52 | }
|
---|
| 53 |
|
---|
| 54 | /**
|
---|
| 55 | *
|
---|
| 56 | * @param num
|
---|
| 57 | * @param exp
|
---|
| 58 | * @return
|
---|
| 59 | */
|
---|
| 60 | double posix_frexp(double num, int *exp)
|
---|
| 61 | {
|
---|
| 62 | // TODO: low priority, just a compile-time dependency of binutils
|
---|
| 63 | not_implemented();
|
---|
[820104d] | 64 | return 0.0;
|
---|
[823a929] | 65 | }
|
---|
| 66 |
|
---|
[c8830a2] | 67 | /**
|
---|
| 68 | *
|
---|
| 69 | * @param x
|
---|
| 70 | * @return
|
---|
| 71 | */
|
---|
| 72 | double posix_cos(double x)
|
---|
| 73 | {
|
---|
| 74 | // TODO: Python dependency
|
---|
| 75 | not_implemented();
|
---|
[820104d] | 76 | return 0.0;
|
---|
[c8830a2] | 77 | }
|
---|
| 78 |
|
---|
| 79 | /**
|
---|
| 80 | *
|
---|
| 81 | * @param x
|
---|
| 82 | * @param y
|
---|
| 83 | * @return
|
---|
| 84 | */
|
---|
| 85 | double posix_pow(double x, double y)
|
---|
| 86 | {
|
---|
| 87 | // TODO: Python dependency
|
---|
| 88 | not_implemented();
|
---|
[820104d] | 89 | return 0.0;
|
---|
[c8830a2] | 90 | }
|
---|
| 91 |
|
---|
| 92 | /**
|
---|
| 93 | *
|
---|
| 94 | * @param x
|
---|
| 95 | * @return
|
---|
| 96 | */
|
---|
| 97 | double posix_floor(double x)
|
---|
| 98 | {
|
---|
| 99 | // TODO: Python dependency
|
---|
| 100 | not_implemented();
|
---|
[820104d] | 101 | return 0.0;
|
---|
[c8830a2] | 102 | }
|
---|
| 103 |
|
---|
| 104 | /**
|
---|
| 105 | *
|
---|
| 106 | * @param x
|
---|
| 107 | * @return
|
---|
| 108 | */
|
---|
| 109 | double posix_fabs(double x)
|
---|
| 110 | {
|
---|
| 111 | // TODO: Python dependency
|
---|
| 112 | not_implemented();
|
---|
[820104d] | 113 | return 0.0;
|
---|
[c8830a2] | 114 | }
|
---|
| 115 |
|
---|
| 116 | /**
|
---|
| 117 | *
|
---|
| 118 | * @param x
|
---|
| 119 | * @param iptr
|
---|
| 120 | * @return
|
---|
| 121 | */
|
---|
| 122 | double posix_modf(double x, double *iptr)
|
---|
| 123 | {
|
---|
| 124 | // TODO: Python dependency
|
---|
| 125 | not_implemented();
|
---|
[820104d] | 126 | return 0.0;
|
---|
[c8830a2] | 127 | }
|
---|
| 128 |
|
---|
| 129 | /**
|
---|
| 130 | *
|
---|
| 131 | * @param x
|
---|
| 132 | * @param y
|
---|
| 133 | * @return
|
---|
| 134 | */
|
---|
| 135 | double posix_fmod(double x, double y)
|
---|
| 136 | {
|
---|
| 137 | // TODO: Python dependency
|
---|
| 138 | not_implemented();
|
---|
[820104d] | 139 | return 0.0;
|
---|
[c8830a2] | 140 | }
|
---|
| 141 |
|
---|
| 142 | /**
|
---|
| 143 | *
|
---|
| 144 | * @param x
|
---|
| 145 | * @return
|
---|
| 146 | */
|
---|
| 147 | double posix_log(double x)
|
---|
| 148 | {
|
---|
| 149 | // TODO: Python dependency
|
---|
| 150 | not_implemented();
|
---|
[820104d] | 151 | return 0.0;
|
---|
[c8830a2] | 152 | }
|
---|
| 153 |
|
---|
| 154 | /**
|
---|
| 155 | *
|
---|
| 156 | * @param x
|
---|
| 157 | * @param y
|
---|
| 158 | * @return
|
---|
| 159 | */
|
---|
| 160 | double posix_atan2(double y, double x)
|
---|
| 161 | {
|
---|
| 162 | // TODO: Python dependency
|
---|
| 163 | not_implemented();
|
---|
[820104d] | 164 | return 0.0;
|
---|
[c8830a2] | 165 | }
|
---|
| 166 |
|
---|
| 167 | /**
|
---|
| 168 | *
|
---|
| 169 | * @param x
|
---|
| 170 | * @return
|
---|
| 171 | */
|
---|
| 172 | double posix_sin(double x)
|
---|
| 173 | {
|
---|
| 174 | // TODO: Python dependency
|
---|
| 175 | not_implemented();
|
---|
[820104d] | 176 | return 0.0;
|
---|
[c8830a2] | 177 | }
|
---|
| 178 |
|
---|
| 179 | /**
|
---|
| 180 | *
|
---|
| 181 | * @param x
|
---|
| 182 | * @return
|
---|
| 183 | */
|
---|
| 184 | double posix_exp(double x)
|
---|
| 185 | {
|
---|
| 186 | // TODO: Python dependency
|
---|
| 187 | not_implemented();
|
---|
[820104d] | 188 | return 0.0;
|
---|
[c8830a2] | 189 | }
|
---|
| 190 |
|
---|
| 191 | /**
|
---|
| 192 | *
|
---|
| 193 | * @param x
|
---|
| 194 | * @return
|
---|
| 195 | */
|
---|
| 196 | double posix_sqrt(double x)
|
---|
| 197 | {
|
---|
| 198 | // TODO: Python dependency
|
---|
| 199 | not_implemented();
|
---|
[820104d] | 200 | return 0.0;
|
---|
[c8830a2] | 201 | }
|
---|
| 202 |
|
---|
[823a929] | 203 | /** @}
|
---|
| 204 | */
|
---|