(end (fix:end-index end (string-length string) caller))
(start (fix:start-index start end caller))
(z
- (cond ((string=? string "+nan.0") (flo:nan.0))
- ((string=? string "-nan.0") (flo:nan.0))
- ((string=? string "+inf.0") (flo:+inf.0))
- ((string=? string "-inf.0") (flo:-inf.0))
- (else
- (parse-number string start end
- (if (default-object? radix) #f radix)
- caller)))))
+ (parse-number string start end
+ (if (default-object? radix) #f radix)
+ caller)))
(if (and (not z) (if (default-object? error?) #f error?))
(error:bad-range-argument string caller))
z))
(or exactness 'implicit-inexact)
radix
sign))
+ ((and (char-ci=? #\i char)
+ (string-prefix-ci? "nf.0" string start end))
+ (parse-complex string (+ start 4) end
+ (if (eq? #\- sign) (flo:-inf.0) (flo:+inf.0))
+ exactness radix sign))
+ ((and (char-ci=? #\n char)
+ (string-prefix-ci? "an.0" string start end))
+ (parse-complex string (+ start 4) end
+ (flo:nan.0)
+ exactness radix sign))
((i? char)
(and (fix:= start end)
(make-rectangular 0 (if (eq? #\- sign) -1 1))))
(get-digits start #f)))))
(define (parse-dotted-5 string start end integer rexponent exactness radix
- sign base bexponent)
+ sign base bexponent)
(parse-complex string start end
(finish-real integer rexponent exactness radix sign
base bexponent)
("1/34" ,assert-exact-rational)
("123+456i" ,assert-complex-nonreal)
("1.23" ,assert-flonum)
- ("+inf.0i" ,assert-complex-nonreal xfail)
- ("-inf.0i" ,assert-complex-nonreal xfail)
- ("1+inf.0i" ,assert-complex-nonreal xfail)
- ("1-inf.0i" ,assert-complex-nonreal xfail)
- ("+inf.0+1i" ,assert-complex-nonreal xfail)
- ("-inf.0+1i" ,assert-complex-nonreal xfail)
- ("+inf.0+inf.0i" ,assert-complex-nonreal xfail)
- ("+inf.0-inf.0i" ,assert-complex-nonreal xfail)
- ("-inf.0+inf.0i" ,assert-complex-nonreal xfail)
- ("-inf.0-inf.0i" ,assert-complex-nonreal xfail)
- ("+inf.0+nan.0i" ,assert-complex-nonreal xfail)
- ("+nan.0+inf.0i" ,assert-complex-nonreal xfail))
+ ("+inf.0i" ,assert-complex-nonreal)
+ ("-inf.0i" ,assert-complex-nonreal)
+ ("1+inf.0i" ,assert-complex-nonreal)
+ ("1-inf.0i" ,assert-complex-nonreal)
+ ("2+inf.0i" ,assert-complex-nonreal)
+ ("2-inf.0i" ,assert-complex-nonreal)
+ ("+inf.0+i" ,assert-complex-nonreal)
+ ("-inf.0+i" ,assert-complex-nonreal)
+ ("+inf.0+2i" ,assert-complex-nonreal)
+ ("-inf.0+2i" ,assert-complex-nonreal)
+ ("+inf.0+inf.0i" ,assert-complex-nonreal)
+ ("+inf.0-inf.0i" ,assert-complex-nonreal)
+ ("-inf.0+inf.0i" ,assert-complex-nonreal)
+ ("-inf.0-inf.0i" ,assert-complex-nonreal)
+ ("+inf.0+nan.0i" ,assert-complex-nonreal)
+ ("+nan.0+inf.0i" ,assert-complex-nonreal))
(lambda (string #!optional assertion xfail?)
(with-expected-failure xfail?
(lambda ()
("#x123+456i" ,assert-complex-nonreal)
("#x1.23p+4-1.ffp-8i" ,assert-complex-nonreal)
("#x1.23p+0" ,assert-flonum)
- ("#x+inf.0i" ,assert-complex-nonreal xerror)
- ("#x-inf.0i" ,assert-complex-nonreal xerror)
- ("#x1+inf.0i" ,assert-complex-nonreal xerror)
- ("#x1-inf.0i" ,assert-complex-nonreal xerror)
- ("#x1p+1+inf.0i" ,assert-complex-nonreal xerror)
- ("#x1p+1-inf.0i" ,assert-complex-nonreal xerror)
- ("#x-1p+1+inf.0i" ,assert-complex-nonreal xerror)
- ("#x-1p+1-inf.0i" ,assert-complex-nonreal xerror)
- ("#x+inf.0+1p+1i" ,assert-complex-nonreal xerror)
- ("#x-inf.0+1p+1i" ,assert-complex-nonreal xerror)
- ("#x+inf.0-1p+1i" ,assert-complex-nonreal xerror)
- ("#x-inf.0-1p+1i" ,assert-complex-nonreal xerror)
- ("#x+inf.0+1i" ,assert-complex-nonreal xerror)
- ("#x-inf.0+1i" ,assert-complex-nonreal xerror)
- ("#x+inf.0+inf.0i" ,assert-complex-nonreal xerror)
- ("#x+inf.0-inf.0i" ,assert-complex-nonreal xerror)
- ("#x-inf.0+inf.0i" ,assert-complex-nonreal xerror)
- ("#x-inf.0-inf.0i" ,assert-complex-nonreal xerror)
- ("#x+inf.0+nan.0i" ,assert-complex-nonreal xerror)
- ("#x+nan.0+inf.0i" ,assert-complex-nonreal xerror))
+ ("#x+inf.0i" ,assert-complex-nonreal)
+ ("#x-inf.0i" ,assert-complex-nonreal)
+ ("#x1+inf.0i" ,assert-complex-nonreal)
+ ("#x1-inf.0i" ,assert-complex-nonreal)
+ ("#x+inf.0+i" ,assert-complex-nonreal)
+ ("#x-inf.0+i" ,assert-complex-nonreal)
+ ("#x+inf.0-i" ,assert-complex-nonreal)
+ ("#x-inf.0-i" ,assert-complex-nonreal)
+ ("#x1p+1+inf.0i" ,assert-complex-nonreal)
+ ("#x1p+1-inf.0i" ,assert-complex-nonreal)
+ ("#x-1p+1+inf.0i" ,assert-complex-nonreal)
+ ("#x-1p+1-inf.0i" ,assert-complex-nonreal)
+ ("#x+inf.0+1p+1i" ,assert-complex-nonreal)
+ ("#x-inf.0+1p+1i" ,assert-complex-nonreal)
+ ("#x+inf.0-1p+1i" ,assert-complex-nonreal)
+ ("#x-inf.0-1p+1i" ,assert-complex-nonreal)
+ ("#x+inf.0+inf.0i" ,assert-complex-nonreal)
+ ("#x+inf.0-inf.0i" ,assert-complex-nonreal)
+ ("#x-inf.0+inf.0i" ,assert-complex-nonreal)
+ ("#x-inf.0-inf.0i" ,assert-complex-nonreal)
+ ("#x+inf.0+nan.0i" ,assert-complex-nonreal)
+ ("#x+nan.0+inf.0i" ,assert-complex-nonreal))
(lambda (string #!optional assertion xfail?)
(with-expected-failure xfail?
(lambda ()