<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Approximatrix Forums — Arithmetic overflow error]]></title>
		<link>https://forums.approximatrix.com/viewtopic.php?id=105</link>
		<atom:link href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=105&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Arithmetic overflow error.]]></description>
		<lastBuildDate>Tue, 26 Jun 2012 14:03:31 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Arithmetic overflow error]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=337#p337</link>
			<description><![CDATA[<p>I find that changing to 9.46E12 seems to fix it; there is no need to change to real*8 or double.</p><p>I am not an F2008 user, so I cannot say why the initial construct of 9.46*10**12 is a problem, yet the later 150.0*10**6 is seemingly ok.</p><p>Regards</p>]]></description>
			<author><![CDATA[null@example.com (petesun)]]></author>
			<pubDate>Tue, 26 Jun 2012 14:03:31 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=337#p337</guid>
		</item>
		<item>
			<title><![CDATA[Re: Arithmetic overflow error]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=336#p336</link>
			<description><![CDATA[<p>Try using DOUBLE PRECISION or REAL*8<br />---<br />John</p>]]></description>
			<author><![CDATA[null@example.com (JohnWasilewski)]]></author>
			<pubDate>Mon, 25 Jun 2012 22:11:45 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=336#p336</guid>
		</item>
		<item>
			<title><![CDATA[Arithmetic overflow error]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=335#p335</link>
			<description><![CDATA[<p>Hi,</p><p>I typed in&nbsp; an example Fortran code from a textbook. But when I compiled it, the arithmetic overflow error occurs. I am using a 64-bit computer. So I was thinking that all the numbers should be in the range. Please help identify what may cause this problem. The code and the compiler message were copied below.</p><p>program ch0504<br />implicit none<br />real :: Light_Minute, Distance, Elapse<br />integer :: Minute, Second<br />real , parameter :: Light_Year = 9.46*10**12<br />! Light_Year : Distance travelled by light<br />! in one year in km<br />! Light_Minute : Distance travelled by light<br />! in one minute in km<br />! Distance : Distance from sun to earth in km<br />! Elapse : Time taken to travel a <br />! distance (Distance) in minutes<br />! Minute : integer number part of elapse<br />! Second: integer number of seconds<br />! equivalent to fractional part of elapse<br />!<br />&nbsp; &nbsp; Light_Minute = Light_Year/(365.25*24.0*60.0)<br />&nbsp; &nbsp; Distance = 150.0*10**6<br />&nbsp; &nbsp; Elapse = Distance / Light_Minute<br />&nbsp; &nbsp; Minute = Elapse<br />&nbsp; &nbsp; Second = (Elapse - Minute) *60<br />&nbsp; &nbsp; print *, &#039;Light takes&#039;,Minute, &#039;Minutes&#039;<br />&nbsp; &nbsp; print *, &#039; &#039;,Second, &#039;Seconds&#039;<br />&nbsp; &nbsp; print *, &#039;to reach the earth from the sun&#039;<br />end program ch0504</p><p>-----------------------build status<br />==============================================================================<br />Open Watcom Make Version 1.9 (Modified 3 Mar 2012)<br />Portions Copyright (c) 1988-2002 Sybase, Inc. All Rights Reserved.<br />Source code is available under the Sybase Open Watcom Public License.<br />See <a href="http://www.openwatcom.org/">http://www.openwatcom.org/</a> for details.<br />&nbsp; &nbsp; &quot;C:\Program Files (x86)\Simply Fortran\mingw-w64\bin\gfortran.exe&quot; -c -o build\ch0504.o&nbsp; &nbsp;-Jmodules .\ch0504.f08<br />.\ch0504.f08:5.40:</p><p>real , parameter :: Light_Year = 9.46*10**12<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1<br />Error: Arithmetic overflow at (1)<br />.\ch0504.f08:17.29:</p><p>&nbsp; &nbsp; Light_Minute = Light_Year/(365.25*24.0*60.0)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1<br />Error: Symbol &#039;light_year&#039; at (1) has no IMPLICIT type<br />Error(E42): Last command making (build\ch0504.o) returned a bad status<br />Should this file be deleted [Yes/No] ? Error(E02): Make execution terminated</p><p>* Complete *</p>]]></description>
			<author><![CDATA[null@example.com (weizhang)]]></author>
			<pubDate>Mon, 25 Jun 2012 19:02:40 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=335#p335</guid>
		</item>
	</channel>
</rss>
