Skip to main content

Settings

Struct Settings 

Source
pub struct Settings {
    pub format: NumberFormat,
    pub comma: bool,
    pub base: Base,
    pub word_size: u32,
    pub all_parens: bool,
    pub real_point: bool,
    pub power_right: bool,
    pub group_digits: bool,
    pub tag_colon: bool,
}
Expand description

The display settings the text depends on.

Fields§

§format: NumberFormat

Real number format.

§comma: bool

Comma as the fraction mark (flag -51); the separator in complex numbers becomes ;.

§base: Base

Binary integer base (flags -11, -12).

§word_size: u32

Binary integer word size in bits, 1-64 (flags -5 to -10).

§all_parens: bool

Show every parenthesis in algebraics (flag -53).

§real_point: bool

Reals with an integer value keep their point (5.), as on the 49G, whose exact integers show without one (not inside unit objects).

§power_right: bool

^ groups to the right (A^B^C is A^(B^C)), as on the 49G; on the 48 it groups to the left.

§group_digits: bool

FIX groups the integer digits by three (1,234.500; 1.234,500 with a comma fraction mark) inside lists, programs, arrays and tagged objects too, as the 49G does; both models group a real that is a whole stack level. Never inside complex numbers, algebraics or units.

§tag_colon: bool

A tagged object inside a composite shows its tag between colons (:T: 5, the 48) or with a trailing one only (T: 5, the 49G, and both models for a whole stack level).

Implementations§

Source§

impl Settings

Source

pub fn standard(model: Model) -> Settings

The defaults of model.

Source

pub fn from_flags(flags: &Flags, model: Model) -> Settings

The settings flags select on model.

Source

pub fn for_editing(self) -> Settings

These settings for text that is edited and compiled again: every digit of a real (STD), binary integers at 64 bits, no digit grouping and tags between colons, so that the text compiles back to the same object; the fraction mark, base and parentheses stay.

Source

pub fn binary(&self, value: u64) -> String

value as a binary integer in the base and word size.

Source

pub fn real(&self, r: &Real) -> String

r as the calculator shows it.

Source

pub fn unit_number(&self, r: &Real) -> String

A unit object’s number or power: an integer value as an integer (2_m^2 even in FIX), anything else in the display mode; never a trailing point or digit groups (oracle-checked: 1.50E0_m^2.50E0 in 2 SCI).

Source

pub fn complex(&self, re: &Real, im: &Real) -> String

A complex number (re,im).

Trait Implementations§

Source§

impl Clone for Settings

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Settings

Source§

impl Debug for Settings

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Settings

Source§

fn default() -> Self

The calculator’s defaults: STD, period, decimal binaries, 64 bits.

Source§

impl Eq for Settings

Source§

impl PartialEq for Settings

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Settings

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.