| 1 | /*
|
|---|
| 2 | * Copyright (c) 2011 Petr Koupy
|
|---|
| 3 | * Copyright (c) 2013 Vojtech Horky
|
|---|
| 4 | * All rights reserved.
|
|---|
| 5 | *
|
|---|
| 6 | * Redistribution and use in source and binary forms, with or without
|
|---|
| 7 | * modification, are permitted provided that the following conditions
|
|---|
| 8 | * are met:
|
|---|
| 9 | *
|
|---|
| 10 | * - Redistributions of source code must retain the above copyright
|
|---|
| 11 | * notice, this list of conditions and the following disclaimer.
|
|---|
| 12 | * - Redistributions in binary form must reproduce the above copyright
|
|---|
| 13 | * notice, this list of conditions and the following disclaimer in the
|
|---|
| 14 | * documentation and/or other materials provided with the distribution.
|
|---|
| 15 | * - The name of the author may not be used to endorse or promote products
|
|---|
| 16 | * derived from this software without specific prior written permission.
|
|---|
| 17 | *
|
|---|
| 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|---|
| 19 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|---|
| 20 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|---|
| 21 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|---|
| 22 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|---|
| 23 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|---|
| 24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|---|
| 25 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|---|
| 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|---|
| 27 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|---|
| 28 | */
|
|---|
| 29 |
|
|---|
| 30 | /** @addtogroup libmath
|
|---|
| 31 | * @{
|
|---|
| 32 | */
|
|---|
| 33 | /** @file Mathematical operations (dummy implementation).
|
|---|
| 34 | */
|
|---|
| 35 | #include <math.h>
|
|---|
| 36 | #include <stdio.h>
|
|---|
| 37 |
|
|---|
| 38 | #define WARN_NOT_IMPLEMENTED() \
|
|---|
| 39 | do { \
|
|---|
| 40 | static int __not_implemented_counter = 0; \
|
|---|
| 41 | if (__not_implemented_counter == 0) { \
|
|---|
| 42 | fprintf(stderr, "Warning: using dummy implementation of %s().\n", \
|
|---|
| 43 | __func__); \
|
|---|
| 44 | } \
|
|---|
| 45 | __not_implemented_counter++; \
|
|---|
| 46 | } while (0)
|
|---|
| 47 |
|
|---|
| 48 | double ldexp(double x, int exp)
|
|---|
| 49 | {
|
|---|
| 50 | WARN_NOT_IMPLEMENTED();
|
|---|
| 51 | return 0.0;
|
|---|
| 52 | }
|
|---|
| 53 |
|
|---|
| 54 | double frexp(double num, int *exp)
|
|---|
| 55 | {
|
|---|
| 56 | WARN_NOT_IMPLEMENTED();
|
|---|
| 57 | return 0.0;
|
|---|
| 58 | }
|
|---|
| 59 |
|
|---|
| 60 | double cos(double x)
|
|---|
| 61 | {
|
|---|
| 62 | WARN_NOT_IMPLEMENTED();
|
|---|
| 63 | return 0.0;
|
|---|
| 64 | }
|
|---|
| 65 |
|
|---|
| 66 | double pow(double x, double y)
|
|---|
| 67 | {
|
|---|
| 68 | WARN_NOT_IMPLEMENTED();
|
|---|
| 69 | return 0.0;
|
|---|
| 70 | }
|
|---|
| 71 |
|
|---|
| 72 | double floor(double x)
|
|---|
| 73 | {
|
|---|
| 74 | WARN_NOT_IMPLEMENTED();
|
|---|
| 75 | return 0.0;
|
|---|
| 76 | }
|
|---|
| 77 |
|
|---|
| 78 | double fabs(double x)
|
|---|
| 79 | {
|
|---|
| 80 | WARN_NOT_IMPLEMENTED();
|
|---|
| 81 | return 0.0;
|
|---|
| 82 | }
|
|---|
| 83 |
|
|---|
| 84 | double modf(double x, double *iptr)
|
|---|
| 85 | {
|
|---|
| 86 | WARN_NOT_IMPLEMENTED();
|
|---|
| 87 | return 0.0;
|
|---|
| 88 | }
|
|---|
| 89 |
|
|---|
| 90 | double fmod(double x, double y)
|
|---|
| 91 | {
|
|---|
| 92 | WARN_NOT_IMPLEMENTED();
|
|---|
| 93 | return 0.0;
|
|---|
| 94 | }
|
|---|
| 95 |
|
|---|
| 96 | double log(double x)
|
|---|
| 97 | {
|
|---|
| 98 | WARN_NOT_IMPLEMENTED();
|
|---|
| 99 | return 0.0;
|
|---|
| 100 | }
|
|---|
| 101 |
|
|---|
| 102 | double atan2(double y, double x)
|
|---|
| 103 | {
|
|---|
| 104 | WARN_NOT_IMPLEMENTED();
|
|---|
| 105 | return 0.0;
|
|---|
| 106 | }
|
|---|
| 107 |
|
|---|
| 108 | double sin(double x)
|
|---|
| 109 | {
|
|---|
| 110 | WARN_NOT_IMPLEMENTED();
|
|---|
| 111 | return 0.0;
|
|---|
| 112 | }
|
|---|
| 113 |
|
|---|
| 114 | double exp(double x)
|
|---|
| 115 | {
|
|---|
| 116 | WARN_NOT_IMPLEMENTED();
|
|---|
| 117 | return 0.0;
|
|---|
| 118 | }
|
|---|
| 119 |
|
|---|
| 120 | double sqrt(double x)
|
|---|
| 121 | {
|
|---|
| 122 | WARN_NOT_IMPLEMENTED();
|
|---|
| 123 | return 0.0;
|
|---|
| 124 | }
|
|---|
| 125 |
|
|---|
| 126 | /** @}
|
|---|
| 127 | */
|
|---|