Skip to content

Use of natnump for Floats #4

Description

@domtronn

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)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions