|
|
|
EnableExplicit
|
|
|
|
|
|
|
|
Global PBEx_Math
|
|
|
|
|
|
|
|
CompilerIf #PB_Compiler_Processor = #PB_Processor_x86
|
|
|
|
PBEx_Math = OpenLibrary(#PB_Any, "PB.Ex_Math_x86.dll")
|
|
|
|
CompilerElseIf #PB_Compiler_Processor = #PB_Processor_x64
|
|
|
|
PBEx_Math = OpenLibrary(#PB_Any, "PB.Ex_Math_x64.dll")
|
|
|
|
CompilerEndIf
|
|
|
|
|
|
|
|
If PBEx_Math
|
|
|
|
Prototype.d Calculate(Calculation.p-Unicode, ErrorOutput)
|
|
|
|
Global Calculate.Calculate = GetFunction(PBEx_Math, "Calculate")
|
|
|
|
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
Define ErrorOutput$ = Space(1024)
|
|
|
|
|
|
|
|
Debug "1 + 2 - 1 = " + Calculate("1 + 2 - 1", @ErrorOutput$)
|
|
|
|
Debug "2^32 = " + Calculate("2^32", @ErrorOutput$)
|
|
|
|
Debug "5 + 2 * 2 = " + Calculate("5 + 2 * 2", @ErrorOutput$)
|
|
|
|
Debug "(10 + 20) * 10 = " + Calculate("(10 + 20) * 10", @ErrorOutput$)
|
|
|
|
Debug "pi * 4 = " + Calculate("pi * 4", @ErrorOutput$)
|
|
|
|
Debug "2.5 + 10 = " + Calculate("2.5 + 10", @ErrorOutput$)
|
|
|
|
Debug "Modulo = " + Calculate("2 % 1 == 0", @ErrorOutput$)
|
|
|
|
Debug "AND condition = " + Calculate("1 == 1", @ErrorOutput$)
|
|
|
|
Debug "sqrt(64) = " + Calculate("sqrt(64)", @ErrorOutput$)
|
|
|
|
Debug "round(5.4) = " + Calculate("round(5.4)", @ErrorOutput$)
|
|
|
|
Debug "is 5 ot 10 greater? = " + Calculate("max(5, 10)", @ErrorOutput$)
|
|
|
|
Debug "15 > 10? = " + Calculate("15 > 10", @ErrorOutput$)
|
|
|
|
Debug "sin(1.5708) = " + Calculate("sin(1.5708)", @ErrorOutput$)
|
|
|
|
|
|
|
|
CloseLibrary(PBEx_Math)
|
|
|
|
|
|
|
|
; IDE Options = PureBasic 5.70 LTS (Windows - x64)
|
|
|
|
; CursorPosition = 27
|
|
|
|
; EnableXP
|
|
|
|
; EnableUser
|
|
|
|
; Executable = PB.Ex_MSSQL_x86.exe
|
|
|
|
; CompileSourceDirectory
|
|
|
|
; EnableCompileCount = 355
|
|
|
|
; EnableBuildCount = 6
|
|
|
|
; EnableUnicode
|