1%D \module 2%D [ file=cldf-pos, 3%D version=2023.04.21, 4%D title=\CONTEXT\ Data Macros, 5%D subtitle=Posit, 6%D author=Hans Hagen, 7%D date=\currentdate, 8%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] 9%C 10%C This module is part of the \CONTEXT\ macro||package and is 11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for 12%C details. 13 14\writestatus{loading}{ConTeXt Posit Numbers / Initialization} 15 16\registerctxluafile{cldf-pos}{autosuffix} 17 18\newposit\pfpi \pfpi 3.1415926535897932384626433832795028841971 19\newposit\pftwopi \pftwopi \floatexpr \pfpi * 2 \relax 20 21% \newfloat\fooA 22% 23% \scratchdimen=123.456pt\relax [\type{dim:} \the\scratchdimen==123.456pt]\par 24% \fooA =123.456\relax [\type{pos:} \the\fooA ==123.456] \par 25% \fooA =\scratchdimen\relax [\type{pos:} \the\fooA ==123.456] \par 26% \scratchdimen=\fooA\relax [\type{dim:} \the\scratchdimen==123.456pt]\par 27% \scratchdimen\dimexpr\fooA+10pt\relax[\type{dim:} \the\scratchdimen==133.456pt]\par 28% 29% \fooA\pfsin \pfpi [\the\fooA]\par 30% \fooA\pfcos \pfpi [\the\fooA]\par 31% \fooA\pfsqrt\pfpi [\the\fooA]\par 32% \fooA\pfexp \pfpi [\the\fooA]\par 33% \fooA\pflog \pfpi [\the\fooA]\par 34% \fooA\pfpow \pfpi 2 [\the\fooA]\par 35 36\endinput 37 |