bernhard_LA 0 Posted July 16, 2021 what is the best method to convert a double value back into a real data type ? var x : double ; y : real ; y: = x ; what are the risk's ? Share this post Link to post
Rollo62 538 Posted July 16, 2021 17 minutes ago, bernhard_LA said: what are the risk's ? http://docwiki.embarcadero.com/Libraries/Sydney/en/System.Real Maybe only issues in older versions, currently it should be equivalent. Share this post Link to post
David Heffernan 2347 Posted July 16, 2021 (edited) Given this definition type Real = Double; I'd say you don't have much to fear. Of course, this code doesn't compile. 1 hour ago, bernhard_LA said: y: = x ; Edited July 16, 2021 by David Heffernan 1 2 Share this post Link to post
A.M. Hoornweg 144 Posted July 18, 2021 I believe the old Turbo Pascal "Real" type is now called Real48 and exists only for compatibility purposes (i.e. if you need to read or write files with data in that format). It is much slower than either Double or Single because it's not a native FPU format. 1 Share this post Link to post