{ } Raw JSON

bundles / scipy 1.17.1 / scipy / io / _harwell_boeing / _fortran_format_parser / ExpFormat / from_number

classmethod

scipy.io._harwell_boeing._fortran_format_parser:ExpFormat.from_number

source: /scipy/io/_harwell_boeing/_fortran_format_parser.py :97

Summary

Given a float number, returns a "reasonable" ExpFormat instance to represent any number between -n and n.

Parameters

n : float

max number one wants to be able to represent

min : int

minimum number of characters to use for the format

Returns

res : ExpFormat

ExpFormat instance with reasonable (see Notes) computed width

Notes

Reasonable should be understood as the minimal string length necessary to avoid losing precision.

Aliases

  • scipy.io._harwell_boeing._fortran_format_parser.ExpFormat.from_number