Page 1 of 1

F64 Library Question

Posted: Mon Nov 15, 2004 1:56 am
by CaddMan
Hello,

I am a bit disappointed that PureBasic does not support double type variables at this time, since most of the CAD APIs I am working with need this functionality to work correctly. I am trying to use the F64 add on library. Using the following code below. How would I correctly assign float values to the doubles StartLine \x \y and EndLine x\ \y ?


Structure Point2D
x.double
y.double
EndStructure

Dim StartLine.Point2D(1)
Dim EndLine.Point2D(1)


StartLine(0) \x
StartLine(0) \y

EndLine(0) \x
Endline(0) \y

Thank You

Posted: Tue Nov 16, 2004 4:06 am
by jack
examples:

Code: Select all

Structure Point2D 
  x.double 
  y.double 
EndStructure 

Dim StartLine.Point2D(1) 
Dim EndLine.Point2D(1) 


F64_Val(StartLine(0)\x,"3.1415926535897932384626433832795") 
F64_Val(StartLine(0)\y,"2.7182818284590452353602874713527") 
OpenConsole()
PrintN(F64_Str(StartLine(0)\x, 15,#F64_Format_Scientific))
PrintN(F64_Str(StartLine(0)\y, 15,#F64_Format_Scientific))

Input()
CloseConsole()
hope this helps :)

Posted: Wed Nov 17, 2004 4:04 am
by CaddMan
Thanks Jack.

That should get me going

Ken