mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-18 21:29:18 +02:00
Cleanup
This commit is contained in:
parent
4d902f9a77
commit
08bd333701
2 changed files with 7 additions and 6 deletions
|
@ -2657,7 +2657,8 @@ object Cyc_string2number_(void *data, object cont, object str)
|
|||
if (rv == STR2INT_SUCCESS) {
|
||||
_return_closcall1(data, cont, obj_int2obj(result));
|
||||
} else if (rv == STR2INT_RATIONAL ||
|
||||
// TODO: is there a more efficient way?
|
||||
// Could still be a rational if numerator is
|
||||
// bignum, so in that case do one more scan
|
||||
((rv == STR2INT_OVERFLOW || rv == STR2INT_UNDERFLOW) &&
|
||||
strchr(s, '/') != NULL)) {
|
||||
double d = string2rational(data, s);
|
||||
|
|
|
@ -48,6 +48,11 @@
|
|||
"rationals"
|
||||
(test 3.0 (numerator (/ 6 4)))
|
||||
(test 2.0 (denominator (/ 6 4)))
|
||||
(test 3.0 (expt 81 1/4))
|
||||
(test #t
|
||||
(< 1.0e+40
|
||||
(/ 33333333333333333333333333333333333333333 3.0)
|
||||
1.2e+40))
|
||||
)
|
||||
|
||||
(test-group
|
||||
|
@ -71,11 +76,6 @@
|
|||
;(test +inf.0 (exact +inf.0))
|
||||
)
|
||||
|
||||
(test-group
|
||||
"rationals"
|
||||
(test 3.0 (expt 81 1/4))
|
||||
)
|
||||
|
||||
(test-group
|
||||
"records"
|
||||
(define-record-type employee
|
||||
|
|
Loading…
Add table
Reference in a new issue