On this page:
top
up

23Number SnipπŸ”— i

superclass:snip-class%

method

(send a-number-snip:snip-class read f)

(or/c (is-a?/c snip% )#f)
Overrides read in snip-class% .
Constructs a number snip from its input.

procedure

num
[ #:exact-prefixexact-prefix
#:inexact-prefixinexact-prefix
#:fraction-viewfraction-view])
num:number?
exact-prefix:(or/c 'always'never'when-necessary)='never
inexact-prefix : (or/c 'always'never'when-necessary)
= 'never
fraction-view:(or/c #f'mixed'improper'decimal)=#f
For a number num, returns a number snip or a string according to the specified format arguments.

The exact-prefix argument specifies whether the representation should carry a #e prefix: Always, never, or when necessary to identify a representation that would otherwise be considered inexact.

Similarly for inexact-prefix. Note however that 'when-necessary is usually equivalent to 'never, as inexact numbers are always printed with a decimal dot, which is sufficient to identify a number representation as inexact.

The fraction-view field specifies how exact non-integer reals - fractions - should be rendered: As a mixed fraction, an improper fraction, or a decimal, possibly identifying periodic digits. For 'decimal, if it’s not possible to render the number as a decimal exactly, a fraction representation might be generated. This is currently the case for complex numbers.

If fraction-view is #f, this option comes from the 'framework:fraction-snip-style preference.

procedure

[ #:exact-prefixexact-prefix
#:inexact-prefixinexact-prefix
#:fraction-viewfraction-view])
exact-prefix:(or/c 'always'never'when-necessary)='never
inexact-prefix : (or/c 'always'never'when-necessary)
= 'never
fraction-view:(or/c #f'mixed'improper'decimal)=#f
This returns a procedure usable in a pretty-print-size-hook implementation, to go with number-snip:number->string/snip . The arguments are as with number-snip:number->string/snip .

procedure

show-prefix?)
num:real?
show-prefix?:boolean?
Makes a number snip that shows the decimal expansion for number. The boolean indicates if a #e prefix appears on the number.

See also number-snip:make-fraction-snip .

procedure

show-prefix-in-decimal-view?)
num:real?
show-prefix-in-decimal-view?:boolean?
Makes a number snip that shows a fractional view of number. The boolean indicates if a #e prefix appears on the number, when shown in the decimal state.

See also number-snip:make-repeating-decimal-snip .
v:any/c
Determines if v is a number snip, i.e., created by number-snip:make-fraction-snip or number-snip:make-repeating-decimal-snip .

All values that answer #t to this predicate are also snip% s.

procedure

( number-snip:get-number ns)real?

Returns the number that this number snip displays.
(subclass?/c text%)
text%:(subclass?/c text%)
Overrides the on-insert and after-insert to replace number-snip% objects that look like ASCII with their corresponding ASCII text.

top
up

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /