Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Meta

Post History

75%
+4 −0
Meta Default Rules: Loopholes

Abusing native number types It's common to restrict inputs, outputs, intermediate algorithm values, etc. to fit into the native number type of the language. This can be a problem for languages li...

posted 3y ago by AndrewTheCodegolfer‭  ·  edited 3y ago by AndrewTheCodegolfer‭

Answer
#2: Post edited by user avatar AndrewTheCodegolfer‭ · 2021-07-25T10:47:10Z (over 3 years ago)
  • ## Abusing native number types
  • It's common to restrict inputs, outputs, intermediate algorithm values, etc. fit into the native number type of the language.
  • This can be a problem for languages like Boolfuck whose only integer type is the 1-bit integer. With a minimum of one bit of input and one bit of output, there exist four Boolfuck programs able to solve any decision problem by abusing the limitation.
  • A program is abusing its number type if it has to be nontrivially changed in order to work for larger numbers.
  • `(x << n) | (x >> (32 - n))` is allowed for bit rotations since the only thing that has to be changed for larger integers is the 32, but hard-coding a list of primes 1-128 is **not** allowed.
  • ## Abusing native number types
  • It's common to restrict inputs, outputs, intermediate algorithm values, etc. to fit into the native number type of the language.
  • This can be a problem for languages like Boolfuck whose only integer type is the 1-bit integer. With a minimum of one bit of input and one bit of output, there exist four Boolfuck programs able to solve any decision problem by abusing the limitation.
  • A program is abusing its number type if it has to be nontrivially changed in order to work for larger numbers.
  • `(x << n) | (x >> (32 - n))` is allowed for bit rotations since the only thing that has to be changed for larger integers is the 32, but hard-coding a list of primes 1-128 is **not** allowed.
#1: Initial revision by user avatar AndrewTheCodegolfer‭ · 2021-07-25T10:46:51Z (over 3 years ago)
## Abusing native number types

It's common to restrict inputs, outputs, intermediate algorithm values, etc. fit into the native number type of the language.

This can be a problem for languages like Boolfuck whose only integer type is the 1-bit integer. With a minimum of one bit of input and one bit of output, there exist four Boolfuck programs able to solve any decision problem by abusing the limitation.

A program is abusing its number type if it has to be nontrivially changed in order to work for larger numbers.

`(x << n) | (x >> (32 - n))` is allowed for bit rotations since the only thing that has to be changed for larger integers is the 32, but hard-coding a list of primes 1-128 is **not** allowed.