Float comparison operators return int 0/1 instead of bool #405

Closed
opened 2026-04-21 00:28:29 +00:00 by navicore · 2 comments
navicore commented 2026-04-21 00:28:29 +00:00 (Migrated from github.com)

Summary

Comparison operators on floats appear to return the legacy int 0/1 instead of true/false. Int comparison correctly returns a bool.

Repro

seq: 11 11 >
  » false
seq: drop
  »
seq: 11.0 11.0 >
  » 0

Int > yields false (bool), but float > yields 0 (int). Presumably <, >=, <=, =, != on floats are similarly affected.

Expected

Float comparisons should return true / false like their int counterparts.

## Summary Comparison operators on floats appear to return the legacy int `0`/`1` instead of `true`/`false`. Int comparison correctly returns a bool. ## Repro ``` seq: 11 11 > » false seq: drop » seq: 11.0 11.0 > » 0 ``` Int `>` yields `false` (bool), but float `>` yields `0` (int). Presumably `<`, `>=`, `<=`, `=`, `!=` on floats are similarly affected. ## Expected Float comparisons should return `true` / `false` like their int counterparts.
navicore commented 2026-04-21 00:30:22 +00:00 (Migrated from github.com)

Confirmed affects >= and = too (and int comparisons still correct):

seq: drop 11.0 11.0 >=
  » 1
seq: drop 11.0 11.0 =
  » 1
seq: drop 11 11 >=
  » true
Confirmed affects `>=` and `=` too (and int comparisons still correct): ``` seq: drop 11.0 11.0 >= » 1 seq: drop 11.0 11.0 = » 1 seq: drop 11 11 >= » true ```
navicore commented 2026-04-21 03:27:26 +00:00 (Migrated from github.com)
ad2058af47109dbae5d9904e1fc74530baccaf60
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
navicore/patch-seq#405
No description provided.