Skip to content

Conversation

@samth
Copy link
Member

@samth samth commented Feb 3, 2026

  1. Fix type of (/ 0.0): Changed type of / from (-> -NonPosReal -NonPosReal) to (-> -NegReal -NonPosReal) to correctly handle (/ (min 0.0 0)).

  2. Avoid optimizing large exact values to floats when they might overflow to infinity.

  3. Convert exact values to floats before using unsafe-fl* in complex multiplication.

Based on and closes PR #1381. Fixes #1042.

1. Fix type of (/ 0.0): Changed from (-> -NonPosReal -NonPosReal) to
   (-> -NegReal -NonPosReal) to correctly handle (/ (min 0.0 0)).

2. Avoid optimizing float exprs when conversion can change result:
   Added safe-to-convert? check to prevent converting large exact
   numbers to infinity before operations.

3. Fix float-complex multiplication crash with exact integer operands:
   The imaginary part calculation was using unsafe-fl* with exact
   integers when non-float optimization preserved exact arithmetic.

Based on PR racket#1381. Fixes racket#1042.
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resyntax analyzed 4 files in this pull request and found no issues.

@samth samth marked this pull request as ready for review February 3, 2026 03:54
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resyntax analyzed 4 files in this pull request and found no issues.

@samth samth merged commit a2f9553 into racket:master Feb 3, 2026
4 checks passed
@samth samth deleted the fix-float-opt branch February 3, 2026 16:14
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

Successfully merging this pull request may close these issues.

random numeric testing failures

1 participant