Skip to content

Commit

Permalink
Initial commit and release
Browse files Browse the repository at this point in the history
  • Loading branch information
ChallengeSY committed Jun 8, 2023
0 parents commit 508e76f
Show file tree
Hide file tree
Showing 312 changed files with 23,754 additions and 0 deletions.
556 changes: 556 additions & 0 deletions ABCgfx.bi

Large diffs are not rendered by default.

76 changes: 76 additions & 0 deletions CSYMath.bi
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#IFNDEF __CSY_MATH_BI__
#DEFINE __CSY_MATH_BI__
const pi = 3.14159265358979323846

function ceil(Byval Param1 as double) as longint
'Always rounds up
return int(Param1 + .999999999)
end function

function remainder(Byval Param1 as double, Byval Param2 as double) as double
'Returns the remainder of a division.
if Param2 = 0 then
return 1e+300
else
return Param1-(int(Param1/Param2)*Param2)
end if
end function

function exLog(Byval Param1 as double, Byval Param2 as double) as double
'Allows logarithms of any base to be used.
return (log(Param1)/log(Param2))
end function

function commaSep(InValue as longint) as string
dim as string FullStr
dim as byte ExtraCommas

FullStr = str(InValue)
if InValue >= 1000 then
for KID as ubyte = 1 to len(str(InValue))
if KID mod 3 = len(str(InValue)) mod 3 AND KID <= len(str(InValue)) - 3 then
FullStr = left(FullStr,KID+ExtraCommas)+","+right(FullStr,len(FullStr)-KID-ExtraCommas)
ExtraCommas += 1
end if
next KID
end if

return FullStr
end function

function degtorad(Amount as double) as double
return Amount*pi/180
end function
function radtodeg(Amount as double) as double
return Amount*180/pi
end function

function irandom(Minimum as integer, Maximum as integer) as integer
return int(rnd * ((Maximum - Minimum) + 1 - 1e-100)) + Minimum
end function

#IF __FB_VERSION__ < "1.01"
function max(ValueA as double, ValueB as double) as double
return iif(ValueA > ValueB,ValueA,ValueB)
end function

function min(ValueA as double, ValueB as double) as double
return iif(ValueA > ValueB,ValueB,ValueA)
end function
#ENDIF

function convertIP(InIP as integer) as string
dim as string LongString, ShortString(4), OutString
LongString = str(hex(InIP,8))

for ID as ubyte = 1 to 4
ShortString(ID) = mid(LongString,ID*2-1,2)
if ID > 1 then
OutString += "."
end if
OutString += str(valint("&h"+ShortString(ID)))
next ID

return OutString
end function
#ENDIF
Loading

0 comments on commit 508e76f

Please sign in to comment.