Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

fixed bug
Source Link
Jo King
  • 48.1k
  • 6
  • 130
  • 187

Perl 6, 2528 characters

{grep({$_-.NumNum+|0-$_},^∞)[^$_]}

Try it online! Try it online!

This is 27actually 30 bytes, but the challenge is scored in characters.

This should work theoretically. This creates a lazy list of numbers that compares the default number type (with arbitrary precision) against the same number converted to a Num datatype, which is a 64-bit floating point number, and returns the first \$n\$ elements of the list.

Here's a version starting at \2ドル^{53}-5\$

Perl 6, 25 characters

{grep({$_-.Num},^∞)[^$_]}

Try it online!

This is 27 bytes, but the challenge is scored in characters.

This should work theoretically. This creates a lazy list of numbers that compares the default number type (with arbitrary precision) against the same number converted to a Num datatype, which is a 64-bit floating point number, and returns the first \$n\$ elements of the list.

Perl 6, 28 characters

{grep({.Num+|0-$_},^∞)[^$_]}

Try it online!

This is actually 30 bytes, but the challenge is scored in characters.

This should work theoretically. This creates a lazy list of numbers that compares the default number type (with arbitrary precision) against the same number converted to a Num datatype, which is a 64-bit floating point number, and returns the first \$n\$ elements of the list

Here's a version starting at \2ドル^{53}-5\$

Source Link
Jo King
  • 48.1k
  • 6
  • 130
  • 187

Perl 6, 25 characters

{grep({$_-.Num},^∞)[^$_]}

Try it online!

This is 27 bytes, but the challenge is scored in characters.

This should work theoretically. This creates a lazy list of numbers that compares the default number type (with arbitrary precision) against the same number converted to a Num datatype, which is a 64-bit floating point number, and returns the first \$n\$ elements of the list.

AltStyle によって変換されたページ (->オリジナル) /