Jump to content

Recommended Posts

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

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 by David Heffernan
  • Like 1
  • Haha 2

Share this post


Link to post

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.

 

 

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×