23 Number Snip
|
superclass: snip-class% |
method
β (or/c (is-a?/c snip%) #f) f : (is-a?/c editor-stream-in%) Overrides read in snip-class%.Constructs a number snip from its input.
procedure
(number-snip:number->string/snip num [ #:exact-prefix exact-prefix #:inexact-prefix inexact-prefix #:fraction-view fraction-view]) β (or/c number-snip:is-number-snip? string?) 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
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.
procedure
(number-snip:make-pretty-print-size [ #:exact-prefix exact-prefix #:inexact-prefix inexact-prefix #:fraction-view fraction-view]) β (number? boolean? output-port? . -> . exact-nonnegative-integer?) 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
procedure
(number-snip:make-repeating-decimal-snip num show-prefix?) β number-snip:is-number-snip? num : real? show-prefix? : boolean?
procedure
(number-snip:make-fraction-snip num show-prefix-in-decimal-view?) β number-snip:is-number-snip? num : real? show-prefix-in-decimal-view? : boolean?
procedure
(number-snip:is-number-snip? v) β boolean?
v : any/c
procedure
(number-snip:get-number ns) β real?
ns : number-snip:is-number-snip?
procedure
(number-snip:remove-decimal-looking-number-snips-on-insertion-mixin text%)
β (subclass?/c text%) text% : (subclass?/c text%)