real - Factor Documentation

real


Vocabulary
math

Class description
The class of real numbers, which is a disjoint union of rationals and floats.

Definition
IN: math

UNION: real rational float ;


Methods
USING: calendar.private kernel math ;

M: real +day float>whole-part swapd 24 * +hour swap +day ;


USING: calendar.private kernel math ;

M: real +hour float>whole-part swapd 60 * +minute swap +hour ;


USING: calendar.private kernel math ;

M: real +minute
float>whole-part swapd 60 * +second swap +minute ;


USING: calendar calendar.private kernel math ;

M: real +month
float>whole-part swapd average-month * +day swap +month ;


USING: calendar calendar.private kernel math ;

M: real +year
float>whole-part swapd days-per-year * +day swap +year ;


USING: kernel math ;

M: real /mod 2dup mod [ swap [ - ] [ /i ] bi* ] keep ; inline


USING: math math.order math.order.private ;

M: real <=> real<=> ; inline


USING: kernel layouts math math.order ;

M: real >integer
dup most-negative-fixnum most-positive-fixnum between?
[ >fixnum ] [ >bignum ] if ; inline


USING: math timers.private ;

M: real >nanoseconds >integer ;


USING: math ;

M: real >rect 0 ; inline


USING: kernel math ;

M: real abs dup 0 < [ neg ] when ; inline


USING: math math.functions ;

M: real absq sq ; inline


USING: math math.order ;

M: real after=? >= ; inline


USING: math math.order ;

M: real after? > ; inline


USING: math math.functions ;

M: real atan >float atan ; inline


USING: math math.order ;

M: real before=? <= ; inline


USING: math math.order ;

M: real before? < ; inline


USING: math math.functions ;

M: real copysign >float copysign ;


USING: math math.functions ;

M: real cos >float cos ; inline


USING: math math.functions ;

M: real cosh >float cosh ; inline


USING: math math.functions ;

M: real e^ >float e^ ; inline


USING: math math.functions ;

M: real e^-1 >float e^-1 ; inline


USING: calendar.format math ;

M: real elapsed-time >integer elapsed-time ;


USING: kernel math ;

M: real imaginary-part drop 0 ; inline


USING: json.private math math.parser ;

M: real json-coerce >float number>string ;


USING: math math.functions ;

M: real lgamma >float lgamma ;


USING: math math.functions ;

M: real log >float log ; inline


USING: math math.functions math.libm ;

M: real log10 >float flog10 ; inline


USING: combinators math math.parser namespaces
prettyprint.backend prettyprint.config prettyprint.custom
prettyprint.sections ;

M: real pprint*
number-base get {
{ 10 [ number>string text ] }
{ 16 [ [ >hex ] "0x" pprint-prefixed-number ] }
{ 8 [ [ >oct ] "0o" pprint-prefixed-number ] }
{ 2 [ [ >bin ] "0b" pprint-prefixed-number ] }
[ unsupported-number-base ]
} case ;


USING: math math.parser present ;

M: real present number>string ;


USING: math ;

M: real real-part ; inline


USING: math math.order.private ;

M: real real<=> (real<=>) ; inline


USING: calendar.format kernel math sequences ;

M: real relative-time
[ relative-time-offset ]
[ dup abs 1 < [ drop ] [ 0 < "hence" "ago" ? " " glue ] if ]
bi ;


USING: kernel math math.extras math.functions ;

M: real round-away-from-zero dup 0 < [ floor ] [ ceiling ] if ;


USING: math math.functions ;

M: real signum sgn ;


USING: kernel math ;

M: real simple-gcd gcd nip ; inline


USING: math math.functions ;

M: real sin >float sin ; inline


USING: math math.functions ;

M: real sinh >float sinh ; inline


USING: math system threads ;

M: real sleep >integer nano-count + sleep-until ;


USING: math math.parser smalltalk.printer ;

M: real smalltalk>string number>string ;


USING: kernel math math.functions math.libm ;

M: real sqrt
>float dup 0.0 <
[ neg fsqrt [ 0.0 ] dip rect> ] [ fsqrt ] if ; inline


USING: io json kernel math math.parser ;

M: real stream-write-json
[ >float number>string ] [ stream-write ] bi* ;


USING: math math.functions ;

M: real tan >float tan ; inline


USING: math math.functions ;

M: real tanh >float tanh ; inline


USING: kernel math math.functions ;

M: real truncate dup 1 mod - ;


USING: cursors math math.functions ;

M: real up/i / ceiling >integer ; inline

AltStyle によって変換されたページ (->オリジナル) /