fabien van mook

all packages "fvm-*"

package "fvm-real2text"

function file "real2text_compose.m"

Function rt = real2text_compose(rt)

returns the struct after the insertion of text 
representations of reals, which are based on 
their decomposition data produced by function
real2text_decompose(), and optionally on the 
powers-of-ten to be printed, which are calculated
by function real2text_simplify().

The input struct rt must have the following fields:
  rt.data   (vectorised input as a one-dimensional 
             cell-array, in which each finite real
             has been replaced by a string)
  rt.realtype   (vector of integers classifying each 
                 element in rt.data with 
                 value 0 for a non-real,
                 value 1 for a finite real, and
                 values 2...5 for non-finite reals 
                 -Inf, +Inf, NaN and NA, respectively)
  rt.decomp.mnt (one-dimensional cell-array of strings 
                 consisting of the sign and mantissa)
  rt.decomp.pot (one-dimensional cell-array of signed 
                 integers indicating the power-of-ten 
                 of the first digit in the mantissa)
  rt.decomp.nsd (one-dimensional cell-array of integers 
                 indicating the number of significant 
                 digits, i.e. length(rt.decomp.mnt{k}) - 1)

The input struct rt may have the following optional 
fields:
  rt.pot_show   (one-dimensional cell-array of signed 
                 integers indicating the power-of-ten, 
                 to be printed)
  rt.nsd_show   (one-dimensional cell-array of integers 
                 indicating the number of significant 
                 digits, to be printed)
  rt.token.plus      (one string consisting of the plus 
                      sign to be printed)
  rt.token.minus     (one string consisting of the minus 
                      token to be printed)
  rt.token.decimal   (one string consisting of the desimal 
                      sign to be printed)
  rt.token.pot_begin (one string printed before the power-of-ten)
  rt.token.pot_end   (one string printed after the power-of-ten)
  rt.token.("-inf")  (one string consisting of the -infinity 
                      symbol to be printed)
  rt.token.("+inf")  (one string consisting of the +infifity 
                      symbol to be printed)
  rt.token.("nan")   (one string consisting of the not-a-number 
                      symbol to be printed)
  rt.token.("na")    (one string consisting of the not-avaiable 
                      symbol to be printed)
  rt.e0_show   (boolean whether to print a zeroth power-of-ten; 
                false at default)
  rt.plus_show (boolean whether to print a plus sign at the
                mantissa and at the power-of-ten; false at
                default)

The output struc rt contains new or renewed fields:
output:
  rt.data (vectorised input as a one-dimensional 
           cell-array, in which each finite and
           nonfinite real has been replaced by 
           a (new) string)


(c) 2026 fabien van mook

2026.08.20 release of this file within package "fvm-real2text" under GNU GPLv3+