Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asserting the type of NaN signals an error #441

Open
eliaslfox opened this issue Feb 14, 2023 · 2 comments
Open

Asserting the type of NaN signals an error #441

eliaslfox opened this issue Feb 14, 2023 · 2 comments

Comments

@eliaslfox
Copy link

On macOS using CCL Version 1.12.1 DarwinX8664

CL-USER> (typep 1d+-0 'double-float)
T
CL-USER> (the double-float 1d+-0)
; Evaluation aborted on #<FLOATING-POINT-INVALID-OPERATION #x302001351E0D>.
@galdor
Copy link

galdor commented Feb 22, 2023

Same bug on Linux x86-64.

@xrme
Copy link
Member

xrme commented May 18, 2024

We end up calling zerop on the NaN value as part of turning the typespec into a ctype.

ccl/level-1/l1-typesys.lisp

Lines 3062 to 3075 in 273dc19

(def-type-translator member (&rest members)
(if members
(collect ((non-numbers) (numbers))
(dolist (m (remove-duplicates members))
(if (and (numberp m)
(not (and (floatp m) (zerop m))))
(numbers (ctype-of m))
(non-numbers m)))
(apply #'type-union
(if (non-numbers)
(make-member-ctype :members (non-numbers))
*empty-type*)
(numbers)))
*empty-type*))

To be honest, I am not sure what to do here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants