[GRASSLIST:896] Re: CELL, FCELL, DCELL type...

Glynn Clements glynn.clements at virgin.net
Mon Aug 4 04:54:30 EDT 2003


Massimiliano Cannata wrote:

> I'm trying write a code that use a raster to make
> calulation....
> so I get the raster cell value (CELL, FCELL, DCELL
> depending on the original map) and then i have to
> use the math.h function
> 
> double pow(double,double)
> 
> so, how do I have to cast CELL, FCELL or DCELL to
> double?
> It seems that
> 
> double x;
> x = (double) CELL
> 
> doesn't work...

It should work.

> more, I have to really do this casting?

ANSI C will automatically cast numeric function arguments to the
appropriate type, so you can just pass CELL values to pow() directly.

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-user mailing list