Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions libs/base/math.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ namespace Math {
//% blockIdentity="Math._constant"
//% block="√2"
export const SQRT2 = 1.4142135623730951;
//% blockIdentity="Math._constant"
//% block="∞"
export const INFINITY = 1.7976931348623157e+308;
Copy link

Copilot AI Jun 17, 2025

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.

/**
* Re-maps a number from one range to another. That is, a value of ``from low`` would get mapped to ``to low``, a value of ``from high`` to ``to high``, values in-between to values in-between, etc.
Expand Down
Loading