https://github.com/keller-michael/integer_square_root_redux
š different ways for integer square root redux in ABAP
https://github.com/keller-michael/integer_square_root_redux
abap example integer measurement runtime sample squareroot
Last synced: 13 days ago
JSON representation
š different ways for integer square root redux in ABAP
- Host: GitHub
- URL: https://github.com/keller-michael/integer_square_root_redux
- Owner: Keller-Michael
- License: mit
- Created: 2022-12-13T08:08:58.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-21T19:52:15.000Z (over 3 years ago)
- Last Synced: 2025-02-25T05:27:38.281Z (over 1 year ago)
- Topics: abap, example, integer, measurement, runtime, sample, squareroot
- Language: ABAP
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# :open_book: Integer square root redux in ABAP
Three different ways for integer square root redux in ABAP with a simple approach to measure runtime. Check this executable [class](/src/zcl_integer_square_roots.clas.abap) written on SAP Business Technology Platform ABAP environment (Steampunk).
* First way is to calculate by brute force. That means double integer value until you get the number for which you are trying to find square root.
* Second way use an equation. This equation says that the sum of the first "n" odd numbers is "n²". So we do that backwards and we count the number of times an increasing odd number can be subtracted from another number. Result is "n".
* Third way is the standard implementation of square root in ABAP.
Please see runtimes. Results may be suprising š¤
The whole idea to do that calculation in ABAP based on the book "Strange Code - Esoteric languages that make programming fun again". Many thanks to the author [Ronald T. Kneusel](https://www.rkneusel.com/) for this wonderful book. Nice to see that the world of programming languages not only consists of the "winners" (widely used programming languages, check TIOBE index for example).
Have fun š