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 Revisions

1 of 2
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.

Jo King
  • 48.1k
  • 6
  • 130
  • 187

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