×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Data type mismatch

Data type mismatch

Data type mismatch

(OP)
Hi,
   I am migrating data from algol to c.I mapped real datatype in algol to double datatype in c.real has 6 bytes storage.i got one formula in unisys manual which is about the internal representation of real the formula is
    mantissa * 8**(exp)
   In my c program i used this formula to convert real to c but i got some precision related problem
For 10.55 in algol i will get 10.5484568985(approximately like this).can anyone help me to resolve this precision problem.
Thanks,
 Mani
 

RE: Data type mismatch

You would need to post an example (or two).
Something along the lines of

CODE

double myCovert ( unsigned char *algolbytes ) {
  // do something
}
int main ( ) {
  unsigned char algolReal[6] = {
    // 6 bytes which represent some known value in Algol
  }
  printf( "Conversion=%f\n", myConvert(algolReal) );
}

Plus, if you have an online link for the format, that would be good as well.
 

--
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.

RE: Data type mismatch

Probably you mean "to convert binary data from Burroughs systems to ...". The real constant 10.55 from Burroughs Algol source text is exactly the same as the double constant 10.55 in C (of course, except implementation defined precision).
As far as I know Burroughs single precision real data word has 39-bit mantissa. Probably your binary data conversion code is wrong because 39-bit mantissa provides ~12 decimal digits precision...
 

RE: Data type mismatch

Is it 6 6-bit bytes or 6 8-bit bytes.  Honeywell level 66 and 6 6-bit bytes which made the words 36 bits.  6 8-bit bytes would make it a 48 bit number.

Is this Algol 60 or Algol 68?  Not aware of any Algol 68 implementations on Burroughs or Honeywell.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close