Math.H History

Hide minor edits - Show changes to output

February 25, 2013, at 11:36 AM by Roberto Guido - corrected informations about return values. Thanks to Alan Barraclough for alert
Changed line 15 from:
double cos (double __x) // returns cosine of x in radians
to:
double cos (double __x) // returns cosine of x
Changed lines 20-22 from:
double sin (double __x) // returns sine of x in radians
double sqrt (double __x) // returns square root of x in radians
double tan (double __x) // returns tangent of x in radians
to:
double sin (double __x) // returns sine of x
double sqrt (double __x) // returns square root of x
double tan (double __x) // returns tangent of x
January 20, 2013, at 08:08 PM by Roberto Guido - corrected definition of atan2(). Thanks Valentin Py for the alert
Changed line 25 from:
double atan2 (double __y, // arc tangent of y/x
to:
double atan2 (double __y, double __x) // arc tangent of y/x
December 22, 2007, at 03:48 PM by Paul Badger -
Changed line 33 from:
!!See
to:
!!!!See also
December 22, 2007, at 03:46 PM by Paul Badger -
Changed line 21 from:
double sqrt (double __x) returns square root of x in radians
to:
double sqrt (double __x) // returns square root of x in radians
December 22, 2007, at 03:27 PM by Paul Badger -
Changed line 18 from:
double modf (double __value, double *__iptr) //breaks the argument value into
to:
double modf (double __value, double *__iptr) // breaks the argument value into
Changed line 27 from:
double log10 (double __x) //logarithm of x to base 10.
to:
double log10 (double __x) // logarithm of x to base 10.
December 22, 2007, at 03:26 PM by Paul Badger -
Changed lines 29-30 from:
double square (double __x) // square of x
to:
double square (double __x) // square of x
December 22, 2007, at 03:10 PM by Paul Badger -
Changed line 15 from:
double cos(double __x) // returns cosine of x in radians
to:
double cos (double __x) // returns cosine of x in radians
December 22, 2007, at 03:10 PM by Paul Badger -
Deleted lines 28-29:
int isnan (double __x) // returns 1 if "not a number"
int isinf (double __x) returns 1 if the argument x is positive or negative infinity
December 22, 2007, at 03:09 PM by Paul Badger -
Changed line 36 from:
* [[../Reference/Float]]
to:
* [[../Reference/float]]
December 22, 2007, at 03:09 PM by Paul Badger -
Changed lines 3-5 from:
Arduino trig and exponential functions use the [[http://www.nongnu.org/avr-libc/user-manual/group__avr__math.html| avr-libc]] library. The library includes a great number of useful mathematical functions, for manipulating floating point numbers.

to:
Arduino trig and exponential functions use the [[http://www.nongnu.org/avr-libc/user-manual/group__avr__math.html| avr-libc]] library. The library includes a great number of useful mathematical functions for manipulating floating point numbers.

December 22, 2007, at 03:07 PM by Paul Badger -
Changed line 37 from:
* [[double]]
to:
* [[../Reference/double]]
December 22, 2007, at 03:07 PM by Paul Badger -
Changed line 36 from:
* [[../Float]]
to:
* [[../Reference/Float]]
December 22, 2007, at 03:05 PM by Paul Badger -
Changed line 36 from:
* [[Float]]
to:
* [[../Float]]
December 22, 2007, at 03:05 PM by Paul Badger -
Changed lines 3-4 from:
Arduino trig and exponential functions use the [[http://www.nongnu.org/avr-libc/user-manual/group__avr__math.html| avr-libc]] library. The library includes a great number of useful mathematical functions, for manipulating floating point numbers. This is why you graduated from the Basic Stamp.
to:
Arduino trig and exponential functions use the [[http://www.nongnu.org/avr-libc/user-manual/group__avr__math.html| avr-libc]] library. The library includes a great number of useful mathematical functions, for manipulating floating point numbers.

December 22, 2007, at 03:04 PM by Paul Badger -
Changed lines 3-4 from:
Arduino trig and exponential functions use the avr-libc library. The library includes a great number of useful mathematical functions, including trigonometric, and logarithmic functions. This is why you graduated from the Basic Stamp.
to:
Arduino trig and exponential functions use the [[http://www.nongnu.org/avr-libc/user-manual/group__avr__math.html| avr-libc]] library. The library includes a great number of useful mathematical functions, for manipulating floating point numbers. This is why you graduated from the Basic Stamp.
December 22, 2007, at 03:02 PM by Paul Badger -
Changed lines 17-18 from:
double modf (double __value, double *__iptr) //breaks the argument value into integral and fractional parts
to:
double modf (double __value, double *__iptr) //breaks the argument value into
// integral and fractional parts
December 22, 2007, at 03:01 PM by Paul Badger -
Changed lines 3-10 from:
The AVR math library, which is included in your sketch by using the line

[@#include <math.h> // (no semicolon)@]

Includes a great number of useful mathematical functions, including trigonometric, and logarithmic functions. This is why you graduated from the Basic Stamp.

The Atmega8 chip, which is now dated, but still supported, does not have enough memory to be able use the math.h library so you will probably need to update to an Atmega168 if you wish to use any of these functions.
to:
Arduino trig and exponential functions use the avr-libc library. The library includes a great number of useful mathematical functions, including trigonometric, and logarithmic functions. This is why you graduated from the Basic Stamp.

The Atmega8 chip, which is now dated, but still supported, does not have enough memory to be able to use the math.h library so you will probably need to update to an Atmega168 if you wish to use any of these functions.
December 22, 2007, at 02:55 PM by Paul Badger -
Deleted lines 13-16:
!!!!Example:

[@ Someone email a small example to pbadger@verizon.net and I'll put it in here @]
July 14, 2007, at 06:27 AM by Paul Badger -
Changed lines 7-8 from:
includes a great number of mathematical functions. This is why you graduated from the Basic Stamp.
to:
Includes a great number of useful mathematical functions, including trigonometric, and logarithmic functions. This is why you graduated from the Basic Stamp.
April 28, 2007, at 05:03 AM by Paul Badger -
Changed line 41 from:
11 See
to:
!!See
April 28, 2007, at 05:03 AM by Paul Badger -
Changed line 42 from:
* [[float]]
to:
* [[Float]]
April 28, 2007, at 05:02 AM by Paul Badger -
Added lines 40-43:

11 See
* [[float]]
* [[double]]
April 28, 2007, at 05:01 AM by Paul Badger -
Changed line 22 from:
double cos(double __x) // returns cosine of x in radians
to:
double cos(double __x) // returns cosine of x in radians
Changed lines 37-38 from:
double square (double __x) // square of x
to:
double square (double __x) // square of x
April 28, 2007, at 05:01 AM by Paul Badger -
Changed lines 22-23 from:
double cos(double __x) // returns cosine of x in radians
double fabs (double __x) // absolute value of a float
to:
double cos(double __x) // returns cosine of x in radians
double fabs (double __x) // absolute value of a float
Changed line 26 from:
double sin (double __x) // returns sine of x in radians
to:
double sin (double __x) // returns sine of x in radians
Changed lines 28-30 from:
double tan (double __x) // returns tangent of x in radians
double exp (double __x) // function returns the exponential value of x.
double atan (double __x) // arc tangent of x
to:
double tan (double __x) // returns tangent of x in radians
double exp (double __x) // function returns the exponential value of x.
double atan (double __x) // arc tangent of x
Changed line 32 from:
double log (double __x) // natural logarithm of x
to:
double log (double __x) // natural logarithm of x
April 28, 2007, at 05:00 AM by Paul Badger -
Changed line 23 from:
double fabs (double __x) //absolute value of a float
to:
double fabs (double __x) // absolute value of a float
April 28, 2007, at 04:59 AM by Paul Badger -
Changed lines 9-10 from:
The Atmega8 chip, which is now dated, but still supported does not have enough memory to be able use the math.h library so you will probably need to update to an Atmega168 if you wish to use any of these functions.
to:
The Atmega8 chip, which is now dated, but still supported, does not have enough memory to be able use the math.h library so you will probably need to update to an Atmega168 if you wish to use any of these functions.
April 28, 2007, at 04:58 AM by Paul Badger -
Added line 4:
Added line 6:
April 28, 2007, at 04:58 AM by Paul Badger -
Changed line 4 from:
{@#include <math.h> // (no semicolon)@]
to:
[@#include <math.h> // (no semicolon)@]
April 28, 2007, at 04:57 AM by Paul Badger -
Changed lines 3-4 from:
The AVR math library, which is included in your sketch by using the line @@#include <math.h>@@ (no semicolon)
to:
The AVR math library, which is included in your sketch by using the line
{@#include <math.h> // (no semicolon)@]
April 28, 2007, at 04:56 AM by Paul Badger -
Changed lines 27-28 from:
double atan (double __x) __ATTR_CONST__
double atan2 (double __y, double __x) __ATTR_CONST__
to:
double atan (double __x) // arc tangent of x
double atan2 (double __y, // arc tangent of y/x
April 28, 2007, at 04:53 AM by Paul Badger -
Changed lines 6-7 from:
The Atmega8 chip, which is now dated but still supported does not have enough memory to be able use the math.h library so you will probably need to update to an Atmega168 if you wish to use any of these functions.
to:
The Atmega8 chip, which is now dated, but still supported does not have enough memory to be able use the math.h library so you will probably need to update to an Atmega168 if you wish to use any of these functions.
Changed lines 13-14 from:
[@ Someone email a little example to pbadger@verizon.net and I'll put it in here @]
to:
[@ Someone email a small example to pbadger@verizon.net and I'll put it in here @]
April 28, 2007, at 04:51 AM by Paul Badger -
Changed lines 4-5 from:
includes a great number of mathematical functions.
to:
includes a great number of mathematical functions. This is why you graduated from the Basic Stamp.
Changed lines 15-17 from:
!!!! List of functions and desciption
to:
!!!! List of more common functions with descriptions
This is just a partial list - check the docs for more obscure functions
April 28, 2007, at 04:49 AM by Paul Badger -
Changed lines 32-34 from:
double square (double __x) // square of x
to:
double square (double __x) // square of x

@]
April 28, 2007, at 04:49 AM by Paul Badger -
Added lines 1-32:
!!math.h

The AVR math library, which is included in your sketch by using the line @@#include <math.h>@@ (no semicolon)
includes a great number of mathematical functions.

The Atmega8 chip, which is now dated but still supported does not have enough memory to be able use the math.h library so you will probably need to update to an Atmega168 if you wish to use any of these functions.

The full docs for math.h may be found [[http://www.nongnu.org/avr-libc/user-manual/group__avr__math.html| here]]


!!!!Example:

[@ Someone email a little example to pbadger@verizon.net and I'll put it in here @]

!!!! List of functions and desciption
[@
double cos(double __x) // returns cosine of x in radians
double fabs (double __x) //absolute value of a float
double fmod (double __x, double __y) // floating point modulo
double modf (double __value, double *__iptr) //breaks the argument value into integral and fractional parts
double sin (double __x) // returns sine of x in radians
double sqrt (double __x) returns square root of x in radians
double tan (double __x) // returns tangent of x in radians
double exp (double __x) // function returns the exponential value of x.
double atan (double __x) __ATTR_CONST__
double atan2 (double __y, double __x) __ATTR_CONST__
double log (double __x) // natural logarithm of x
double log10 (double __x) //logarithm of x to base 10.
double pow (double __x, double __y) // x to power of y
int isnan (double __x) // returns 1 if "not a number"
int isinf (double __x) returns 1 if the argument x is positive or negative infinity
double square (double __x) // square of x

Share