Skip to content

Latest commit

 

History

History

ifElse

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Writing if and else statements without actually writing them

Problem: check if the given number is even or odd for first 10k integers greater or equalt to zero.

Performance

  • Mean execution time for branched_ifElse is 4.396 seconds
  • Mean execution time for branchless_ifElse is 4.015 seconds

Note

This piece of code does not represent Branchless Programming completely, but writing if-else (or even if - else if - else) statements without actually writing them and using logical operations instead made a slight performance boost so I posted this method in this repository.