Skip to content

added infinity#1

Draft
not-fritos wants to merge 1 commit into
mainfrom
atisa-123-custom_blocks
Draft

added infinity#1
not-fritos wants to merge 1 commit into
mainfrom
atisa-123-custom_blocks

Conversation

@not-fritos

Copy link
Copy Markdown
Member

No description provided.

@not-fritos not-fritos marked this pull request as draft June 17, 2025 02:07
@not-fritos not-fritos requested a review from Copilot June 17, 2025 02:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a new constant for infinity alongside existing math constants.

  • Introduces INFINITY constant with a block representation of "∞"
  • Defines the value as the maximum finite double instead of true infinite

Comment thread libs/base/math.ts
export const SQRT2 = 1.4142135623730951;
//% blockIdentity="Math._constant"
//% block="∞"
export const INFINITY = 1.7976931348623157e+308;

Copilot AI Jun 17, 2025

Copy link

Choose a reason for hiding this comment

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

The value assigned here is the maximum finite double, not mathematical infinity. In JavaScript/TypeScript you can use Infinity or Number.POSITIVE_INFINITY, or rename this to MAX_VALUE if you intend the largest finite number.

Suggested change
export const INFINITY = 1.7976931348623157e+308;
export const INFINITY = Infinity;

Copilot uses AI. Check for mistakes.
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.

2 participants