Hello all,

> If I set
> 
> CoordBase::dx = 40/48
> 
> I get an error that dx should not be set to 0. I assume that Cactus
> is doing an integer division because the operands of the division have no
> fractional part. I think it should instead do a real division because
> the parameter is real-valued. Is this desirable and/or possible?
> 
> I can work around the above problem by using
> 
> CoordBase::dx = 40.0/48
There was a bit of a discussion on this related to the new parfile
parser (piraha) here:

http://cactuscode.org/pipermail/users/2013-March/003352.html

There were ended up making things such that the type of the target
parameter does not play a role until the very end. I think the
pre-piraha parfile parser then had code that would evaluate 40/48 using
floating point arithmetic and CCTK_ERROR if the result of 40/48. was not
an integer to 15 digits or so. So that may be a middle ground. It would
mean that CoordBase::dx = 40/48 sets dx to 0.8333 but Driver::ncells =
40/48 aborts with an error. For the later one can use int(40/48) to get
truncation at the end.

I'd be happy having the target parameter type decide on what the parser
expects to find (so that eg string parameter values are never
interpreted as expressions and eg "a::name = 08/15" is allowed). :-)

BTW I have not prodded anyone about the niceness of having clickable
links to archived emails in the mailing list emails very recently have
I? Please consider ourselves prodded.

Yours,
Roland



-- 
My email is as private as my paper mail. I therefore support encrypting
and signing email messages. Get my PGP key from http://keys.gnupg.net.

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Users mailing list
[email protected]
http://cactuscode.org/mailman/listinfo/users

Reply via email to