(Answer) (Category) LON-CAPA User Help : (Category) Authoring : (Category) Authoring Problems :
How do I code an absolute value?
in the script block:
$a=-2; $c=&abs($a);
in the text block: I have $a and $c.

displays:
I have -2 and 2.

[Append to This Answer]
Previous: (Answer) How do I display dollar signs in my problem?
Next: (Answer) Parameters for parts problems
This document is: http://help.loncapa.org/cgi-bin/fom?file=89
[Search] [Appearance] [Show This Answer As Text]
This is a Faq-O-Matic 2.719.
This FAQ administered by the LON-CAPA team at MSU. Submit a help request ticket to contact us.