Skip to content

Instantly share code, notes, and snippets.

View h8nor's full-sized avatar

h8nor

  • GPG: 0xB5DE5869
View GitHub Profile
@h8nor
h8nor / Square_root.bas
Last active April 19, 2019 14:08
Calculating the square root of a natural number
Option Explicit
'12345678901234567890123456789012345bopoh13@ya67890123456789012345678901234567890
Function Square_root_Diophantine(ByVal Square_number As Long) As Currency
Dim Number As Integer: Const Rank_places As Long = 10 ^ 2
Do While Square_number > Number
Number = Number + 1
Square_number = Square_number - 2 * Number
Loop: Square_root_Diophantine = Number ' Square_root for N