13.07.2015 Views

xlop-doc.pdf. - Mirror

xlop-doc.pdf. - Mirror

xlop-doc.pdf. - Mirror

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Macro \opexport allow to export a number in a macro. It’s an extrato version 0.23 which is very usefull to exchange datas between <strong>xlop</strong> andthe outside world. The first argument is a number in the <strong>xlop</strong> sense, that is,either a number write with figures, or a variable name. The number is translatedin a form directly acceptable for TEX and hold in the second argumentwhich should be a macro name. However, note that decimal separator willbe the one specified bydecimalsepsymbol (without its possible braces).source\opmul*{5}{3.141592654}{F}macro:­>15.70796327 \opexport{F}{\fivepi}\texttt{\meaning\fivepi}We can use this macro to typeset numbers calculated by <strong>xlop</strong> in an arraywith a decimal alignment, or to initialize a counter or a length (don’t forgetthe unit in the last case).4.3 Figures of NumbersMacros \opwidth, \opintegerwidth, and \opdecimalwidth indicate numberof digits of the whole number, of its integer part, of its decimal part respectively.The first argument is the examined number and the second oneindicates the variable where result will be record.123456.1234 is writtenwith 10 figures (6 in theinteger part and 4 in thedecimal part).source\opcopy{123456.1234}{a}%\opwidth{a}{na}%\opintegerwidth{a}{ia}%\opdecimalwidth{a}{da}%\opprint{a} is written with\opprint{na} figures (\opprint{ia} inthe integer part and \opprint{da} inthe decimal part).Macro \opunzero delete all the non-significant zeros of the numberpassed as argument.Before : 00150.00250After : 150.0025source\opcopy{00150.00250}{a}%Before : \opprint{a}\par\opunzero{a}%After : \opprint{a}Macros \integer and \opdecimal give the integer part and the decimalpart of a number respectively. First argument is the number to process,and the second one is the variable name which hold the result.Integer part: 37Decimal part: 69911source\opcopy{­37.69911}{a}%\opinteger{a}{ia}%\opdecimal{a}{da}%Integer part: \opprint{ia}\parDecimal part: \opprint{da}25

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!