Error with mathematical calculation

I have to do this calculation which I do with the following source:

int analogPin = 0;   // Pressure sensor connected to analog pin 0
long val = 0;   // variable to store the read value

void setup()
{
   Serial.begin(9600);      // opens serial port, sets data rate to 9600 bps
}

void loop()
{

    val = analogRead(analogPin);   // read the input pin (getting value of around 840-860)
    
    val = ( 1 - ( val/ 1013.25 ) ^ 0.19) ) / 22.558;
    
    Serial.print("Value: ");
    Serial.println(val);
    
    delay(1000);

}

This line gives an error:

val = ( 1 - ( val/ 1013.25 ) ^ 0.19) ) / 22.558;

The error is:

In function 'void loop()':
error: invalid operands of types 'double' and 'double' to binary 'operator^

I hope someone can help to solve this. I am totally new to the Arduino.

Thank you in advance!

humm, isn't your val variable declared as an integer? in te code you give it values like a float (with decimals). from what i read on the ard ref pages, arduino doesn't handle floats just char, int and long. anyone cares to comment? (and please help with my push button question!!)

You are correct about that, I changed that after posting.

The Arduino environment does support this type of code:

float var = 0;

But, it consumes a lot of extra memory... I am running already into the limits of the memory of the Atmega8.

Would it be really hard to use the Atmega168 on the Arduino board (not the mini)?

The Arduino reference pages at Arduino - Home state:
Variables

Variables are expressions that you can use in programs to store values, like e.g. sensor reading from an analog pin. They can have various types, which are described below. Floating point variables and operations are not currently supported.

char
int
long
string
array

i know that the atmega168 has twice as much programming space as atmega8. the pin configuration is different. this web page has a datasheet on atmega168 -- Arduino Playground - ArduinoMini

best,
A

Damn. It appears that the Arduino core is now small enough to support basic operations with floats. I'll update the reference according. Unfortunately, Arduino still doesn't support exponentiation, which I assume is what you're trying to do with the "^".

i know that the atmega168 has twice as much programming space as atmega8. the pin configuration is different. this web page has a datasheet on atmega168 -- Arduino Playground - ArduinoMini

I think it should be possible to use the Atmega168 in the 'standard' Arduino board, I read about it here:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1159499314/

See posting #9 from user 'mellis' and the messages after that posting.

Does Arduino support the functions exp (raise e to a power) and log (natural log)? If so, you can raise A to the B power using the following formula:

float pow (float A, float B)
{
return exp (B * log(A));
}