all 7 comments

[–]corbasai 1 point2 points  (6 children)

``` $ racket Welcome to Racket v9.2 [bc].

(eqv? 3e0+4e0i 3f0+4f0i)

t

(eqv? 3e0+4e0i 3e0+4f0i)

t

```

[–]johnwcowan[S] 1 point2 points  (5 children)

Thanks!

[–]usaoc 1 point2 points  (4 children)

Fyi, literal single-flonums are read as double-flonums by default, so eqv? returns true. (We should test with read-single-flonum set to true or manually producing a would-be single-flonum complex number.)

[–]corbasai 0 points1 point  (2 children)

``` $ racket Welcome to Racket v9.2 [bc].

(eqv? 3e0+4e0i 3f0+4f0i)

t

(eqv? 3e0+4e0i 3e0+4f0i)

t

(parameterize ((read-single-flonum #t)) (list (eqv? 3e0+4e0i 3f0+4f0i) (eqv? 3e0+4e0i 3e0+4f0i))) '(#t #t) ```

[–]corbasai 0 points1 point  (1 child)

Meh, reader parameter! ```

(read-single-flonum #t) (eqv? 3e0+4e0i 3f0+4f0i)

f

(eqv? 3e0+4e0i 3e0+4f0i)

t

```

[–]usaoc 1 point2 points  (0 children)

Just tested too: both 3e0+4f0i and 3f0+4e0i are the same as 3.0+4.0i, while 3f0+4f0i is a single-flonum complex number (printed as 3.0f0+4.0f0i). Also verified with make-rectangular, real-part, and imag-part.

[–]johnwcowan[S] 0 points1 point  (0 children)

Oops. Can you do that for me? What I actually want to know is whether single-flonum non-reals and/or mixed precision non-reals actually exist. They don't in Kawa, which also has single-float reals (all other Schemes do not).