Skip to content

__fixed_point_format__

builtin · libnexusinterp/corefcn/pr-output-proprietary.cc

: val = __fixed_point_format__ ()
: old_val = __fixed_point_format__ (new_val)
: old_val = __fixed_point_format__ (new_val, "local")

Query or set the toggle that decides whether Nexus factors out a common scale when printing a matrix.

With the toggle on, a single scaling factor is shown on the first line, picked so that the largest element of the matrix needs only one digit before the decimal point. For example:

fixed_point_format (true)
logspace (1, 7, 5)'
ans =

  1.0e+07  *

  0.00000
  0.00003
  0.00100
  0.03162
  1.00000

Here the first entry looks like 0 even though it is really 1, so enable fixed_point_format with care to avoid misreading values.

Given the "local" option from within a function, the change applies only to that function and the routines it calls, and the prior value is reinstated on return.