RE: [pcgen] [DOCS]  DEFINE TAG Doc improvement
> -----Original Message-----I believe this is what happens.
> From: Eddy Anthony [mailto:eddyba@...]
>From my own experience with formulas I found that after all
>the math is done PCGen will return a whole number, discarding any
>decimal, is this right.
>Is this kind of truncation going on in division during theIt is not truncated until all processing is done unless the .TRUNC tag
>working of any formulas (I would guess not as this seems to
>be what the .TRUNC tag is for)
is used in the formula.
>Speaking of .TRUNC I find the example confusing, I'm not aNo, the above example would truncate 3 (useless) divide TL by that and
>programmer so I'm not familiar with the concept. it reads:
>Truncation - would divide TL by 3, truncate and then multiply by 2.
then multiply by 2 and then truncate that answer again.
(TL/3).TRUNC*2 would divide TL by 3, then truncate, then multiply by 2
and truncate again.
>This is a circular definition, my guess is that .TRUNC simply dropsIt always truncates. No rounding up.
>the decimal in effect rounding down. Is there any case
>where it rounds up?
>Is there an operator to make a number round up, or round to theNo.
>Is there even a need for that?Not that I've come across.
~ PCGen BoD
~ OS Silverback
- Thanks Barak
So to sum up-
1) To truncate is to drop the decimal or in other words round down.
2) To truncate an operation one should enclose it in perenthisis like so:
(a+b).TRUNC (I'll be fixing the example in the docs).
One last question, can you truncate a variable? or this even nessissary?
For example DEFINE:FooDoo|CL/3
Will FooDoo already be truncated as it is the result of a completed formula?
Thanks for the info on the Total variable for the CONTAINS tag, I think I
have enough to make some edits.
PCGen Doc Gibbon
> Thanks BarakNo problem.
> So to sum up-Correct.
> 1) To truncate is to drop the decimal or in other words round down.
> 2) To truncate an operation one should enclose it in perenthisisCorrect again (as I understand it)... PCGen has some strange ways of
> like so:(a+b).TRUNC (I'll be fixing the example in the docs).
determining precedence, but the above will guarantee that the
operation gets truncated and not just the last operand.
> One last question, can you truncate a variable? or this evenI think you could, but unless someone enters a decimal in the variable
in a .lst file, I wouldn't see any need to.
> For example DEFINE:FooDoo|CL/3Yes. That's how a lot of our SA tags that use variables work. To use
> Will FooDoo already be truncated as it is the result of a completed
SA:Foo Doo Ability %/day|FooDoo
This would show nothing until third level and then it would show Foo
Doo Ability 1/day until sixth level where it would show Foo Doo
Ability 2/day, etc.
> Thanks for the info on the Total variable for the CONTAINS tag, IGood! it's nice to see the docs being fixed up. Thanks to you and
> think I have enough to make some edits.
Barak (at the local CC)
~ PCGen BoD
~ OS Silverback