Using #define for math function

What data type is used for #define? Is it a long when doing math?

Example
#define foo 10.0/123.56

It is a text replacement. So it can be anything.

#define foo2 "It is a text replacement"
Serial.println (foo2);

I can be a macro.
#define DIVY(a) a/=123.56
x = 10.0;
DIVY (x);

I appreciate the reply but you did not answer the question
Which specifically had to do with the math question

I know all the various forms define can take
But I want to know what precision is involved when doing math

I can be a macro

It is a macro

But I want to know what precision is involved when doing math

By default, any integer constant will be cast to the size of the platform's "int" type

imsmooth:
I appreciate the reply but you did not answer the question

He answered your question with precision and detail.

Which specifically had to do with the math question

No, it did not...

What data type is used for #define?

The data-type for #define is exactly what @Caltoa stated, text.

But I want to know what precision is involved when doing math

I assume you are referring to the expression in your post...

10.0/123.56

In which case, the expression is evaluated by the compiler using double precision floating point (64 bit).

Coding Badly, are you in the Due era ?
I'm still in the Uno era, and floating point is 32-bit for me.
http://arduino.cc/en/Reference/Float
http://arduino.cc/en/Reference/Double

imsmooth:
#define foo 10.0/123.56

That's a slightly dangerous example because it's implied that it is a numeric constant but whether the expression is actually evaluated as you have shown it will depend on the precedence of any other expressions around it. To ensure that it is treated as an atomic unit, it would be better to put parenthesis around the value.

#define foo (10.0/123.56)

But even that is not the recommended way to define your constants - defining them as const variables is preferred because it gives you an explicit type as well as a value.

const float foo = 10.0/123.56;

Note, most Arduinos (Uno, Mega, etc.) run on AVR chips. The AVR compiler has made the decision that double uses the same representation as float (32-bit IEEE single precision format). Given the chips are 8-bit chips, and it has to do multiple instructions to handle 16, 32, or 64-bit data types, it is probably a reasonable decision to use a smaller format.

If you use an Arm based chip (Due, DigiX, Teensy 3.x) then double is 64-bits. Note, none of these chips have hardware floating point, so the floating point is simulated in software.

Thank you all the last few answers were what I was looking for

Good point was mentioned about the brackets it was just hard to remember all this as I'm typing on my phone for my responses

What I'm actually doing is slightly different as shown below
#define rise 32450
#define run 400
#define slope (rise/run)

So this will evaluate as a double?
Are there any advantages to doing "slope" with defines versus creating a function?

Caltoa:
Coding Badly, are you in the Due era ?

Constant expressions are reduced by the compiler using double precision. How the target evaluates the expression is irrelevant because it never does.

Any advantages to using to find the slope versus creating a function to evaluate the slope

#define rise 32450
#define run     400
#define slope (rise/run)

81

imsmooth:
What I'm actually doing is slightly different as shown below
#define rise 32450
#define run 400
#define slope (rise/run)

So this will evaluate as a double?

No. It is an integer and will be 81 as AWOL pointed out.
As described in reply #1, expression evaluation is based on the types used in the expression
and then there is a little more explanation in reply #3.

Note: naked constants are decimal integers unless they specify otherwise.

--- bill

imsmooth, I hope you don't mind that I repeat myself: it is a text replacement.
Not a text variable as in c-language text "Hello World", but text as plain pre-compiler text in a text editor.
You are still thinking in numbers. They will become numbers only after the defines have been solved.

#define rise 32450
#define run 400
#define slope (rise/run)

That is the same as:

#define slope(32450/400)

The compiler replaces the text and after that the compiler starts compiling the source code.
If you want to make the compiler use float, use 32450.0 and 400.0

Here is a useful explanation and summary for what the preprocessor directive #define does:

http://www.cplusplus.com/doc/tutorial/preprocessor/

How preprocessor directives are actually implemented depends to some extent on the particular compiler.

I agree with the crowd that says don't use define for constants. It avoids what you were worried about happening with define. What type will my number be? Declared constant variables are typed.

constant long rise = 32450L;
constant long run = 400L;
constant long slope = (rise/run);

This way you'll know what type they are.