Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!yale!quasi-eli!cs.yale.edu!johnk%suned From: johnk%suned@cs.yale.edu (john james kuszewski) Newsgroups: comp.lang.fortran Subject: conversion to double precision Summary: how do I convert real to double properly? Keywords: double precision single precision convert type Message-ID: <25734@cs.yale.edu> Date: 4 Aug 90 22:23:38 GMT Sender: news@cs.yale.edu Organization: /usr/local/lib/news/rn/organization Lines: 31 Nntp-Posting-Host: zoo-gw.cs.yale.edu Originator: johnk@suned.CS.Yale.Edu I'm having some difficulty converting REAL variables to DOUBLE PRECISION. All the manuals I've seen say that the REAL value is put in the most significant portion of the D.P. variable and the least significant portion is zeroed out. However, when I execute REAL X X = 1.23E0 TYPE *, 'SINGLE', X TYPE *, 'DOUBLE', DBLE(X) I get SINGLE 1.230000 DOUBLE 1.23000001907349 If I'm reading the manual properly, those least-significant D.P. digits should be zeros. What's the problem here? If this is what FORTRAN is supposed to do, how can I force it to zero out those least-significant digits? Sorry if this is a stupid question, but it's driving me nuts. Thanks. John Kuszewski kuszewsk@euler.biology.yale.edu .sig under construction