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

Use of natnump for Floats #4

Open
domtronn opened this issue Jun 23, 2016 · 0 comments
Open

Use of natnump for Floats #4

domtronn opened this issue Jun 23, 2016 · 0 comments

Comments

@domtronn
Copy link

Thanks for such a useful utility, this is a godsend for working with multi resolution CSS!

Unfortunately though, there seems to be a bug related to multiplying by a float since ELisp casts to the most granular number type...

It seems like you're using natnump as a predicate for whether or not a number is positive or negative (see here), however, this predicate also checks the number is an integer.

Performing an operation of 100 × 0.75, like so;

(* 100 0.75)      ;; 75.0
(natnump 75.0)    ;; nil
(natnump 75)      ;; t

Means natnump returns nil causing a cannot replace with negative number! error.

Could I suggest swapping out the predicate for just a (< 0 number)?

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

1 participant