Added the Float-Complex type for consistency with the new float types.
Inexact-Complex has been kept as a synonym for backward compatibility. original commit: 52bd739d00491d2a78b62c6d6e89fb5eaf6ae046
This commit is contained in:
parent
92b3f9af03
commit
c547da857e
|
@ -1,7 +1,8 @@
|
|||
#lang s-exp "type-env-lang.rkt"
|
||||
|
||||
[Complex -Number]
|
||||
[Inexact-Complex -InexactComplex]
|
||||
[Float-Complex -InexactComplex] ; for consistency with float vs inexact-real
|
||||
[Inexact-Complex -InexactComplex] ; for backward compatiblity
|
||||
[Number -Number]
|
||||
[Integer -Integer]
|
||||
[Real -Real]
|
||||
|
|
|
@ -68,7 +68,7 @@ not necessary when using @racket[+] or @racket[-]. When mixing
|
|||
floating-point numbers of different precisions, results use the
|
||||
highest precision possible.
|
||||
|
||||
On a similar note, the @racket[Inexact-Complex] type is preferable to
|
||||
On a similar note, the @racket[Float-Complex] type is preferable to
|
||||
the @racket[Complex] type for the same reason. Typed Racket can keep
|
||||
@tech[#:doc '(lib "scribblings/reference/reference.scrbl") #:key
|
||||
"inexact numbers"]{inexact}
|
||||
|
@ -93,8 +93,8 @@ present and
|
|||
@tech[#:doc '(lib "scribblings/reference/reference.scrbl") #:key
|
||||
"inexact numbers"]{inexact}
|
||||
for the literal to be of type
|
||||
@racket[Inexact-Complex]; @racket[0.0+1.0i] is of type
|
||||
@racket[Inexact-Complex] but @racket[+1.0i] is not.
|
||||
@racket[Float-Complex]; @racket[0.0+1.0i] is of type
|
||||
@racket[Float-Complex] but @racket[+1.0i] is not.
|
||||
To get the most of
|
||||
Typed Racket's optimizer, you should also favor rectangular
|
||||
coordinates over polar coordinates.
|
||||
|
|
|
@ -35,7 +35,7 @@ any expression of this type will not evaluate to a value.}
|
|||
@deftogether[(
|
||||
@defidform[Number]
|
||||
@defidform[Complex]
|
||||
@defidform[Inexact-Complex]
|
||||
@defidform[Float-Complex]
|
||||
@defidform[Real]
|
||||
@defidform[Float]
|
||||
@defidform[Nonnegative-Float]
|
||||
|
|
Loading…
Reference in New Issue
Block a user